Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I wonder if it is possible to use
GraalPython
as a Java library to interpret Python code on a standard JVM. If so, would it be a good choice to replace
Jython
(which only supports Python 2.7)?
Is this possible without importing the entire GraalVM project? I expect only
Truffle
and the Python interpreter built on top of it should be necessary.
If this is not possible, are there any good Java implementations of Python 3 available?
You should be able to run any GraalVM language on any JDK as their are just Java programs. However, the performance will be affected a lot. Moreover, languages like python consist of additional resources (standard library files, etc.) that you would have pull from GraalVM too.
This document about GraalVM JavaScript discusses this in more detail and describes how to run GraalVM JavaScript on stock JDK without compromising the performance. Some of it can be applicable to GraalPython.
https://github.com/graalvm/graaljs/blob/master/docs/user/RunOnJDK.md
Tl;dr: it will be much easier to use GraalVM. It's full JDK distribution. You are not missing on anything. If you can't, there are some ways.
–
–
–
Thanks for contributing an answer to Stack Overflow!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.