Wouldn't it be great to write scripts in Java? (Shush, yes it would be!)
Three problems:
- Java is verbose
- compile ~> execute
- slow JVM launch
Three fixes:
- Java 12
- single-source file execution (since 11)
- Graal AOT compilation
I want to combine these into a wrapper around Graal AOT-compiled scripts.
While the script file can have any name you want, the class it contains must be called Script
.
Unfortunately, Graal currently only supports Java 8 (i.e. bytecode level 52), so neither the scripts nor Caliz.java
can use newer language features or APIs.
Sad.
😭