logoalt Hacker News

vlovich123 • last Tuesday at 3:27 PM • 2 replies • view on HN

The problem is that “Python” the language includes native poorly isolated FFI interfaces exposed by CPython. So the language isn’t “Python” but CPython. That’s why alternate implementations like PyPy haven’t seen adoption despite having a very mature JIT while languages like JavaScript have JITs that put CPython’s performance to shame.


Replies

bunderbunder • last Tuesday at 4:17 PM

It’s also part of why Python has been so successful in many domains. I was there for Python’s takeover of the data space, and I got quite used to porting things from Java (static, JIT, decent at multithreading) to Python (dynamic, interpreted, GIL) and realizing substantial performance improvements in the process.

It’s kind of wild how nice Python’s C extension system, which enables basically zero cost interop with native code, is for certain purposes. It supports a situation that’s comparable to the games industry’s tradition of putting a Lua or Lisp tip on top of a C++ iceberg.

jeremyjh • yesterday at 8:30 PM

> The problem

Who is this a problem for?

I think there is enough evidence to conclude that most language ecosystems cannot support multiple implementations that are fit for general purpose usage. There are almost no successful examples, and there are many, many failures.

The most successful things I can think of:

C & C++ - often does require at least some pre-processor logic or different build system settings.

Java - I'm not 100% sure - I think there are credible implementations of both the JVM and compiler though of course almost everyone is building from the openjdk or the commercial fork.

Nodejs & Bun - Most of NPM just works.

...

Thats it. Honorable mentions like C#/Mono exist, but if you look at that ecosystem a majority of applications only ever built with one of those, not both.

There are niches maybe like some subsets of scheme or common lisp - but I think most apps have a single implementation creating the builds that they ship. There are re-implementations perhaps that would count that I don't know enough about like Delphi/Lazarus, but I truly don't think there is another mainstream example.

In Haskell, SPJ noted years ago that GHC was really the reference implementation and he no longer considered standards work to be worthwhile (though it has continued past that).

Others I think have reach the same conclusions, such as Ruby. I could be missing something but I don't think most platforms should even aspire to support this.