Live data from Hacker News

GraalPy – A high-performance embeddable Python 3 runtime for Java

graalvm.org

41–50 of 151 posts

Re: GraalPy – A high-performance embeddable Python 3 runtime for Java

#41
post #20

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

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.

Re: GraalPy – A high-performance embeddable Python 3 runtime for Java

#42
post #20

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.

[deleted]

Re: GraalPy – A high-performance embeddable Python 3 runtime for Java

#43
post #35

Earlier quoted context omitted.

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.

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.

Re: GraalPy – A high-performance embeddable Python 3 runtime for Java

#44
post #34

I guess what makes Python interesting right now is the integration with ML toolchains, CUDA, Metal/MLX, pytorch, tensorflow, LLM encoders/decoders, etc. more than Python the language. But can GraalVM run those codes meaningfully when Python is merely used for glue code with the important bits implemented in native code?

The reasons for all this stuff having been developed in Python also make Python interesting right now, all by themselves. It did not happen by accident; this stuff was developed fairly recently and there was no shortage of mature languages to choose from.

The people disliking the language are very vocal about it, but there is a huge amount of silent people that loves it and an even bigger amount that just like it as much as alternatives. It's mainstream now, not trending like 10 years ago, so there is no hype about it anymore. We just use it to do stuff.

Add to that the existing excellent ecosystem, the strong culture of scientific stacks and a very good story for providing c-extentions (actually the best one in all scripting languages because of things like cibuildwheel).

It's only in small tech bubbles like HN that devs find it surprising.

Re: GraalPy – A high-performance embeddable Python 3 runtime for Java

#45
post #20

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

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.

Re: GraalPy – A high-performance embeddable Python 3 runtime for Java

#46
post #19

Earlier quoted context omitted.

Graal let's you compile native binaries

Graal is many things (a marketing nightmare). The guest language part is orthogonal to the native packager AFAIK.

Yes, but I was under the impression that graal-level inter-op was limited to packages the graal toolchain could compile.

Thus, while swift and graal both depend on llvm, they use different variants and there's no real way to make inter-op between swift and graal (even using the llvm it which graal is said to be able to consume).

e.g., I believe this announcement represents the work to compile a python (3.11) and some proof-of-concept python packages using graal toolchain, to spur other packages to support the same.

So I'd really love to be wrong, but I believe building under the graal llvm is the common factor.

Re: GraalPy – A high-performance embeddable Python 3 runtime for Java

#47

Is there a way to embed Python 3 into Swift like this?

I haven't seen embedding using graal/vm, or inter-op using the native JVM FFI.

There is (active, 2K stars) https://github.com/pvieito/PythonKit and I've heard of people being able to deploy apps with python on the app store. YMMV.

Re: GraalPy – A high-performance embeddable Python 3 runtime for Java

#49
post #35

Earlier quoted context omitted.

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.

Did you look into Jython back then?

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

Re: GraalPy – A high-performance embeddable Python 3 runtime for Java

#50
post #24
post #20

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

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.

Post reply on HN