Feather2 / README.md
Feather2
A scripting language for the JVM, with two goals :
- 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.
- 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
- New generic classes cannot be defined.
Existing generic classes, such as
List<T>
are fully supported though. - No inner classes.
- No nested functions (Like Java).
- No Kotlin-like companion objects. Instead, val/var and fun can all be static. (like Java)
- No lambdas (This is the biggest limitation, and I hope to work on it soon).
- All functions must be declared within a class (like Java).
- 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
- 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.