Live data from Hacker News

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

graalvm.org

31–40 of 151 posts

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

#31
post #8
post #4

Earlier quoted context omitted.

Python implementations naturally don't have any GIL in regards to JVM or CLR variants, there is no such thing on those platforms. YAML and JSON have both tried to replicate the XML tooling experience, only worse. Schemas, comments, parsing and schema conversions tools.

I think GraalPython does have a GIL, see https://github.com/oracle/graalpython/blob/master/docs/contr... - and if by "there is no such thing on those platforms" you mean JVM/CLR not having a GIL, C also does not have a GIL but CPython does.

My mistake, as I assumed they took the same decision as jython and IronPython.

https://jython.readthedocs.io/en/latest/Concurrency/#no-glob...

https://wiki.python.org/moin/IronPython

The difference between JVM, CLR and C in regards to parallel and concurrent code is that they are built for those kind of workloads, and have a memory model proper, hence not needing a GIL.

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

#32
post #19

Does it have to be run in a GraalVM, or any JVM implementation is fine?

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.

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

#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.

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

#35
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.

Did you look into Jython back then?

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

#36

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?

I am willing to live with Python as the Lisp we deserve to have, on this AI wave, when it finally gets a proper JIT story we can rely on, regardless of the workload.

Currently it is a mix and match of an herculean engineering effort mostly ignored by the community (PyPy), DSLs for GPGPUs, bunch of C and C++ libraries that people keep referring to as "Python" when any language can have similar bindings, jython, IronPython, GraalPy,...

So it isn't for lack of trying, at least we finally have CPython folks more welcoming to performance improvements, and JITs.

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

#37
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.

Using Python as C and C++ REPL of sorts has been common in academia since it took the scripting crown away from Perl and Tcl, which were used during the late 90's.

Example see the Bioinformatics papers from that period, and the Perl tooling used alongside the research.

Already in 2003 CERN was using Python on some of their build infrastructure (see CMT), Grid Computing scripting efforts, and we had Python trainings available to us.

Now there is a difference between a REPL of sorts, scripting OS tasks, and going full blown applications with a pure interpreter.

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

#39
post #20

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

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.
Post reply on HN