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
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
Of course in the real life there are de facto implementations and language features give way to better/worse tradeoffs.
With that out of the way, Python is basically the de facto glue language. It is very often used to provide a scripting API over lower level C libraries. To be ergonomic in this function, CPython (the major implementation) exposed some internal details of its execution model, which C libraries can reach into. This makes it very hard to make more aggressive optimizations, as one example a C library can just increase/decrease the reference count of an object. Another design decision (that got some discussion recently) is the GIL (global interpreter lock) that makes python much less competitive than something like Java. (JS also does a single thread of execution, though there are ways around it).
JS has a different use case, so access to the C world doesn't impose such restrictions on it.
> Edit: Python has no JIT
There are quite a few JITs:JIT-compiler for Python https://pypy.org/
Python enhancement proposal for JIT in CPython https://peps.python.org/pep-0744/
And there are several JIT-compilers for various subsets of Python, usually with focus on numerical code and often with GPU support, for example
Numba https://numba.pydata.org/numba-doc/dev/user/jit.html
Taichi Lang https://github.com/taichi-dev/taichi
See https://docs.python.org/3/whatsnew/3.13.html#an-experimental...
In 3.14 and up you can enable JIT by setting the env var PYTHON_JIT=1
Much of the initial work on the JIT came from Microsoft's Faster CPython team: https://lwn.net/Articles/1029307/
Python it’s not hard to write a module in pure C that manipulates other Python objects. This means the representation of Python objects has to be stable enough for the C code. V8 does not allow that.
https://nodejs.org/api/n-api.html
I’ve only skimmed this, but it sure sounds like it lets you write C code that operates on JS objects. In fact, it explicitly says “APIs exposed by Node-API are generally used to create and manipulate JavaScript values.”
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.
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, [...]".