I'd have expected it to be hand rolled assembly for the major ISAs, with a C backup for less common ones.
How much energy has been wasted worldwide because of a relatively unoptimized interpreter?
I'd have expected it to be hand rolled assembly for the major ISAs, with a C backup for less common ones.
How much energy has been wasted worldwide because of a relatively unoptimized interpreter?
MSVC's support for musttail is hot off the press:
> The [[msvc::musttail]] attribute, introduced in MSVC Build Tools version 14.50, is an experimental x64-only Microsoft-specific attribute that enforces tail-call optimization. [1]
MSVC Build Tools version 14.50 was released last month, and it only took a few weeks for the CPython crew to turn that around into a performance improvement.
[1] https://learn.microsoft.com/en-us/cpp/cpp/attributes?view=ms...
For comparison: when Javascript was first designed, performance wasn't a goal. Later on, people who had performance as a goal worked on Javascript implementations. Thanks to heroic efforts, nowadays Javascript is one of the language with decently fast implementation around. The base design of the language hasn't changed much (though how people use it might have changed a bit).
Python could do something similar.
So the problem is basically that a simple JIT is not beneficial for Python. So you have to invest a lot of time and effort to get a few percent faster on a typical workload. Or you have to tighten up the language and/or break the C ABI, but then you break many existing popular libraries.
For all its dynamism, Python doesn't have anything closer to becomes:.
I would say that by now what is holding Python back is the C ABI and the culture that considers C code as Python.
Most of the time, people don't use any of these customisations, don't they?
So you'd need machinery that makes the common path go fast, but can fall back onto the customised path, if necessary?
For frequent, short-running scripts: start-up time! Every import has to scan a billion different directories for where the module might live, even for standard modules included with the interpreter.
The new `uv` is making good progress there.
Apparently people that care about performance do run Windows.
Eh, what about users? Games are made for windows, because that's where users (= players) are?
That's even more true for mobile and console games.