Hacker News new | past | comments | ask | show | jobs | submit login

What is the use-case for GraalPy? To be honest I don't understand why would anyone want to use it.



I worked at a company where data scientists wrote python code using pandas and we had port it to java and a library called keanu that was very useful but soon became unmaintained.

Of course this was very time consuming and unrewarding, all because only java applications could be deployed to production due to a stupid top-down decision.

This GraalPy sounds like something I wish existed back then.


jep[0] has existed for a while now, and does what GraalPy is doing quite well.

I'm using it for similar purposes as you stated and for that it works quite well. A research group I am collaborating with does a lot of their work in one Java application (ImageJ for microscopy), so by integrating my Python processing code into that application, it finds its way a lot quicker into the daily workflows of everyone in that group.

Most recently I've also extended the jep setup to include optional Python version bootstrapping via uv[1], so that I can be sure that the plugins I'm writing have the correct Python version available, without people having to install that manually on the machine.

[0]: https://github.com/ninia/jep

[1]: https://github.com/astral-sh/uv


Did you look into Jython back then?


Jython has historically lagged hard, often falling behind for very extended periods. For a time their releases basically just stopped, which led to them missing support for pretty much anything between 2.7 and 3.6 (iirc). I know the project basically rebooted at some point, but I've since lost interest.


Not to mention the biggest drawback imho. Those alternative implementations don't support C extensions.


Jython was dead for a long time. It might be back a little now, but there is still no Python 3 support.

GraalPy is much more active and more compatible.


Not me, someone else in the company did, I don’t remember why it was dismissed.


Ghidra embeds Python scripting via Jython, which is stuck on Python 2. Switching to GraalPy would allow Python 3 scripting.

Any other Java programs that want a scripting engine could use it as well.


Besides all the nice answers given by others, a big one was not mentioned: performance!

Graal can do pretty advanced JIT-compilation for any Graal language, plus you can mix-and-match languages (with a big chunk of their ecosystems) and it will actually compile across language boundaries. And we haven’t even mentioned Java’s state of the art GCs that can run circles around any tracing GC, let alone the very low throughput reference counting.


I guess for pure python applications, they'd rather throw more hardware at the problem than messing with the JVM.


For serial workloads it’s very very hard to scale by hardware, though. CPUs aren’t getting 2x faster as they used to.

Also, what is “messing with the JVM”? That’s like one of the most battle tested technologies out there, right next to the Linux kernel.


Don't get me wrong, I love the JVM.

The unfortunately common irrational aversion to JVM aside, there's also the fear of "using it wrong".


Picture working for a big, non-tech corporation. Your BU only does Java because it has always been thus and Jeff the SVP is a law grad and doesn't want anything to change because of perceived risk. GraalVM allows smart people who have to work within such limitations to still write (mostly) the software they want while still vaguely relating it to Java for decision makers.


Those "smart people" write blackboxes in esoteric languages that only the same person maintains.

Everyone else has to write wrappers to interact with that blackbox. God forbid someone daring to even change the code, because it basically doesn't even need/use junit tests. Eventually the smart person gets bored and moves to something else, that tool then gets rewritten to Java in two days by someone else.

End of story.


Not so vaguely, either. The dev story is not Java but the deploy story is.


Minecraft Mods can only be written in Java and I want my kid to learn python.

Jython is still 2.x and it'd be nice to let my kid write a minecraft mod in python. Not a business use case but a use case.


When I was learning programming, my coding class used a Bukkit plugin that connected to Python. I can't remember what it was called, but that was for Minecraft 1.7.10.

Not sure if you were wanting Python specifically, but KubeJS lets you use JavaScript for mods. I think there's also a clojure integration.


Thank you. My 3rd grader knows basic python so I'd prefer to stick with that or Scratch


Maybe this would be an interesting alternative runtime environment for PySpark? I think currently PySpark runs in Python and somehow interacts with a JVM and relies on copying data from one to the other.


Data scientists trapped in bureaucracy?


I am assuming - With this, JVMs needing integration with LLMs can embed LLMs in JVM instead of making outbound API calls. If my assumption is right - wouldn't this improve performance of consumer applications?


Thankfully some LLMs also have Java bindings to the same native libraries used by Python.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: