Live data from Hacker News

CPython Internals Explained

github.com

1–10 of 54 posts

Re: CPython Internals Explained

#4
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

Re: CPython Internals Explained

#5
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.

Re: CPython Internals Explained

#6
post #4

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

It is not that numpy bypasses public interfaces. It uses documented C APIs. V8, as far as I know, does not have that.

Re: CPython Internals Explained

#7
post #4

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

In 3.14 and up you can enable JIT by setting the env var PYTHON_JIT=1

Re: CPython Internals Explained

#8
post #4

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

It is not that numpy bypasses public interfaces. It uses documented C APIs. V8, as far as I know, does not have that.

V8 itself might not, but, say, Node does and that doesn't torpedo performance. Was Node-API just better designed than Python's FFI?

Re: CPython Internals Explained

#9
post #4

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

As someone who has many times dived into deep rabbit holes like this (e.g. how does JavaScript's prototype-based class work?), some effective ways to handle this is to ask follow up questions, use web search or ask for references. Deep search also helps. Often it corrects itself or takes back claims that have no basis. At the very least, it provides references that you can read yourself.

Of course, you can't really do all of that on a free plan.

That's far from ideal, but if you are motivated and care about these technical details (which you probably do), you can get pretty good results.

=====

Putting all of this aside, you can sometimes find YouTube videos on obscure channels that talk about these things. Chances are that someone who cares to make a YouTube video about these hardcore topics know what they are talking.

Re: CPython Internals Explained

#10
post #5

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.

Just to name alternatives: Cpython, Pypy, jython, ironpython.

Then, there quite a few python-likes out there.

I wish they would stay precise.

Post reply on HN