13 comments

[ 3.3 ms ] story [ 79.2 ms ] thread
Very interesting! Gonna look through this for sure in the next weeks
(comment deleted)
I've been comparing various platforms and discussing them with ChatGPT—for instance, why Python's execution is slower than JavaScript's V8. It claimed this is due to mtechnical debt and the inability to change because libraries like NumPy bypass public interfaces and access data directly.

I'm wondering how much of that is true and what is just a hallucination."

Btw: JavaScript seems to have similar complexity issues.

Edit: Python has no JIT

For what it's worth, I really don't get the downvotes. I think it is an interesting question, and it brought interesting answers.

No clue if that's the reason for the downvotes, but maybe next time don't mention ChatGPT and just formulate this as "From what I read, [...]".

I wish they would just go back to calling it Python, since it’s the Python that everyone knows and uses. No one gets confused over Python the spec and Python the implementation. Every time I see “CPython” i have to double check we’re just talking about Python.

I guess they “CPython’ed” back when people thought Jython would take off , and it never did because Java sucks.

A lot to unpack there, but the language and the implementation are different.

JavaScript and Node.js are different too.

I feel like when the goal is to talk about the internals of it, then it makes sense to call it CPython.

In general, I never, ever see anyone saying "I will write a CPython script". Everybody says "Python" in my experience... do you see it differently?

EDIT: I don't think that your opinion deserves to be downvoted, though...

I find it's usually referred to as CPython when discussing something specific to the implementation or internals of Python that don't apply to Pypy, which seems to be the alternative Python implementation with the most traction.

No harm in being explicit right? Tis part of the zen of Python after all.

Had to write a fairly substantial native extension to Python a couple years ago and one of the things I enjoyed was that the details were not easily "Googleable" because implementation results were swamped by language level results.

It took me back to the old days of source diving and accumulated knowledge that you carried around in your head.

https://www.dave.org/posts/20220806_python/

Great write up, thank you for sharing it! Quick question though, in your first code example (dynamic enum with a metaclass) what is "m" in this line towards the start?

    Py_DECREF(m)
Is it the metaclass?
There's a file on docs.python.org explaining the C api. The rest is pretty straightforward, at least until recently when free threading was introduced (IDK about now). Main hassle is manually having to track reference borrowing etc. Understandable in Python 2, but another tragedy in Python 3.
This looks quite nice. I always wished there was something like "Ruby Under a Microscope" for Python (and other languages). It was quite instrumental for my deeper understanding of the language.