Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Build steps for embedding graalvm #550
Is it possible to embedd graaljs or other graal based language into a JVM project?
We have a large JVM based project that currently uses Nashorn. It would be useful to allow execution of R or Python code via graal in the project. Is it possible to bring these other languages into a JVM project, or do we effectively switch tool chain?
Looking at graaljs for instance, it isn't possible to bring in the related libraries via something like gradle.
So, would I be correct in saying the development process would be:
Thanks a lot for your excellent questions.
Yes that is one way of using GraalVM, if you want to develop with a normal JDK. If you configure GraalVM as your default JDK in your IDE of choice it will pick up Graal-SDK automatically. So step (1) would not be needed and you would have access to the languages in your test cases. You can also run Gradle with GraalVM.
We are currently investigating how we can nicely deploy Graal.js + Graal on Maven so we can execute it on a normal JDK 11 as well. This should make it easier for certain people to migrate from Nashorn. Note that we don't plan to deploy Python, Ruby or Node.js this way, so you will need GraalVM for that.
Just today @wirthi published a blog post about migrating from Nashorn. Please also see our Nashorn migration guide.
Hope this was helpful. Feel free to close if you have no further questions.
Thanks, that clarifies it for me. I also found the following article on InfoQ very useful.
I like the idea of creating native images for our applications, however, we make use of dynamic byte code generation and reflection via MethodHandles. This is integrated with Nashorn to create a dynamic execution environment. Unfortunately, the wording in limitiations, suggests there's no plan to support this in the near future.