Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make blaze native-image compatible #15

Open
asm0dey opened this issue Feb 21, 2019 · 1 comment
Open

Make blaze native-image compatible #15

asm0dey opened this issue Feb 21, 2019 · 1 comment

Comments

@asm0dey
Copy link

asm0dey commented Feb 21, 2019

Corresponding issue in graalvm tracker: oracle/graal#772
Main point: currently blaze uses nashorn as js engine, potentially using graal.js instead will make blaze native-image build-able.
If it will be possible to build blaze with native-image then we'll get almost imstant startup time, which is must have for scripting.

@agentgt
Copy link

agentgt commented May 15, 2019

I just glanced through blazes code base and even if nashhorn was removed/replaced it still would not work for plain Java because Blaze uses dynamic reflection to call the methods as seen here:

https://github.com/fizzed/blaze/blob/master/blaze-core/src/main/java/com/fizzed/blaze/jdk/TargetObjectScript.java

One of the problem is that there isn't really a truffle implementation of Java. Consequently the "Script" would have to be compiled either with just the regular JDK or JDK + native-image. native-image blaze.jar calling slower JDK compiled Java is probably slower than just a pure JDK (just a guess).

The only way I can see this working blaze would have to do code generation to build a stub to call the tasks to avoid the reflection and then call the graalvm to compile the Java code to native.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants