Hacker News new | ask | show | jobs
by hangonhn 892 days ago
Does Python even have a language specification? I've been told that CPython IS the specification. I don't know if this is still true. In the Java world there is a specification and a set of tests to test for conformation so it's easier to have alternative implementations of the JVM. If what I said is correct, then I can see how the optimized alternative implementation idea is less likely to happen.
2 comments

Well, for Python the language reference in the docs[0] is the specification, and many things there are described as CPython implementation details. Like: "CPython implementation detail: For CPython, id(x) is the memory address where x is stored." And as another example, dicts remembering insertion order was CPython's implementation detail in 3.6, but from 3.7 it's part of the language.

[0] https://docs.python.org/3/reference/index.html

There is a pretty detailed reference that distinguishes between cpython implementation details and language features at least. There was a jvm python implementation even. The problem is more that a lot of the libraries that everyone wants to use are very dependent on cpython's ffi which bleeds a lot of internals.