Re:The CPython Bytecode Compiler Is Dumb
by kazinator on Monday February 25, 2019 @01:27AM
(#19243479)
> there are notes in the documentation that call out parts of CPython's behaviour as "implementation-specific"
In a document like this, that means "doing whatever CPython does in a way that we are not bothering to commit to documentation" (and that any other implementation will have to reverse engineer and implement).
Not quite true - there are notes in the documentation that call out parts of CPython's behaviour as "implementation-specific".
These are quite rare though. I seem to recall the suggestion being made that MicroPython shouldn't call itself "an implementation of Python" simply because its internal string encoding is UTF-8.
> This also leads to the sad fact that every non-CPython implementation has to provide C API that's compatible with CPython if they want to be adopted widely.
A specification for the C API wouldn't necessarily help with this. The problem for alternative implementations is that the C API is closely tied to CPython internals - there is no reason that having a specification would change that.
Designing and specifying a more abstracted API would be useful - but I don't see it happening.