Exit Full View

Feather2

A scripting language for the JVM, with two goals :

  1. For 3rd party extensions/macros to your application. In this setting, Feather includes a Sandbox, which only allows access to classes that you consider safe.
  2. As a standalone scripting language for command line tools.

The syntax is inspired by Kotlin, but Feather isn't as feature-rich as Kotlin.

All scripts are compiled to Java Bytecode. The runtime performance is almost identical to Java (as it produces almost identical bytecode).

Still in development. It doesn't work yet! This is a complete rewrite. The first version works (with some bugs), but I made many design mistakes. There are also some breaking changes to feather's syntax.

Status

Still in development. Not quite usable yet.

Limitations

  1. New generic classes cannot be defined. Existing generic classes, such as List<T> are fully supported though.
  2. No inner classes.
  3. No nested functions (Like Java).
  4. No Kotlin-like companion objects. Instead, val/var and fun can all be static. (like Java)
  5. No lambdas (This is the biggest limitation, and I hope to work on it soon).
  6. All functions must be declared within a class (like Java).
  7. Fully qualified class names are only allowed in import statements. IMHO, this isn't a limitation, it just enforces good practice. YMMV. If there is a clash of names without the qualification, then use as on an import statement. e.g. import com.example.Color as ExampleColor
  8. Feather makes no distinction between Null and NotNull types. Like Java, without a validator.

Build Instructions

Assuming you have a Java Virtual Machine installed, gradle should take care of all other dependencies.

./gradlew

Running the Hello World script

From the project's root folder :

build/install/feather2/bin/feather2 HelloWorld.feather

To pass arguments into the script :

build/install/feather2/bin/feather2 HelloWorld.feather -- foo bar

The result should be :

Hello World
    foo
    bar

-- marks the end of parameters to the feather compiler, and the remainder are passed to your static fun main( args : String... ) method.

Additional Documentation