Live data from Hacker News

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

graalvm.org

101–110 of 151 posts

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

#102
post #96

Earlier quoted context omitted.

I think your comment needs to mention that Python has syntax for type annotations and two mature type checkers (mypy and pyright) with more under development. Python is thus very much part of the modern statically typed languages scene (moreso than Go) whereas Ruby isn't at all. Many people wouldn't touch Python today if it weren't for this.

> Python is thus very much part of the modern statically typed languages scene (moreso than Go) Python’s type system is substantially more complex than Go’s - it’s probably more complete , but given it’s optional nature, less sound . In “modern” type systems, is completeness considered more important than soundness? The success of TypeScript suggests it is.

Since basically every single type system has escape hatches (casts), yes, I would say completeness is more important than soundness.

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

#103
post #34

Earlier quoted context omitted.

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 pro…

I’ve always found Python to be sort of loved on HN. Not by everyone or course but I guess it depends on each of our experiences on here. I’m usually rather surprised when I meet people who genuinely dislike Python, because that seems like such an odd occurrence. Even if people don’t “love” the language most people seem to have had rather fond experiences or memories of it. Usually criticism comes down to its inefficiencies, but those aren’t exactly unreasonable critiques.

As I said it’s anecdotal, but in my experience Python gets a lot of love compared to something like Java or C#. Both of which are often met with real harshness. Hell I’ve ranted unseemly about C# myself.

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

#104
post #94

Earlier quoted context omitted.

I think your comment needs to mention that Python has syntax for type annotations and two mature type checkers (mypy and pyright) with more under development. Python is thus very much part of the modern statically typed languages scene (moreso than Go) whereas Ruby isn't at all. Many people wouldn't touch Python today if it weren't for this.

> two mature type checkers I’ve never quite understood how this works. Surely a type system is absolutely fundamental to a language - how can you have multiple incompatible ones? Do you need to choose a particular type checker for each project? Are you limited to only using third-party libraries that use the same type checker?

Look at JavaScript and typescript - Python’s typing is maybe halfway to that gold standard but there were other typed languages based on js. Python is special in that it provides type hinting syntax which is not used by the interpreter, so writing types doesn’t require the Byzantine build systems of js.

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

#105
post #93

Earlier quoted context omitted.

> an OO system that looks like it has been bolted in, compared to Ruby I think the two languages just have different design philosophies. In Python, functions are fundamental and classes are built on top of them. In Ruby, objects are fundamental and functions (i.e. Procs etc) are themselves objects. You could just as well claim that in Ruby, functions look like they have been bolted in. For example, you can’t call a…

Isn't Python's functions are just objects with a __call__ method, and such objects has a syntax sugar allowed them to be called like a function.

Functions are objects are functions are objects… heard that from a little schemer

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

#106
post #33

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

> You can use GraalPy with GraalVM JDK, Oracle JDK, or OpenJDK https://www.graalvm.org/latest/reference-manual/python/

Thanks. I actually managed to run the quick example with Temurin Java 22. Maybe that is what they mean by "OpenJDK": java.vm.name=OpenJDK 64-Bit Server VM, java.vendor.version=Temurin-22.0.2+9

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

#107

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

Update. I actually managed to run the quick example with Temurin Java 22: java.vm.name=OpenJDK 64-Bit Server VM, java.vendor.version=Temurin-22.0.2+9

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

#108
post #34

Earlier quoted context omitted.

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 pro…

Python has many issues that are quite clear when you operate at some kind of scale and need proper multiprocessing/multithreading support. And its not just the GIL, you get very unexpected behaviors when dealing with exit handlers and signal handlers in edge cases. Having seen what other languages look like it just doesn’t feel like a language that was designed well for running at scale.

The tooling has markedly improved though. Things like typing and compile time checks, great. But its also funny to me that some of the fastest tools for python are being built in rust (eg uv).

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

#110
post #60

In case someone is interested, here are some benchmark results comparing GraalPy and others with JDK8 using the Are-we-fast-yet benchmark suite: https://stefan-marr.de/downloads/tmp/awfy-bun.html And here is a table representation of all benchmarks and the geomean and median overall results: http://software.rochus-keller.ch/awfy-bun-summary.ods The implementation of the same benchmark suite runs around factor 2.4 (ge…

Your mileage may very much vary, much like pypy this is very inconsistent and highly dependent on your workload (as well as your dependencies).

My limited experience was that on re-heavy workload pypy is several times slower than cpython (~3x compared to 3.10) and graal is even worse (~6x compared to 3.11).

Post reply on HN