logoalt Hacker News

phonon • yesterday at 5:42 PM • 1 reply • view on HN

Yes, exactly. If you can get a 2-3x speedup in CPython just with type annotations, and then a possible additional 2-3x by dropping down to "Static Python," that may be an overall near optimal solution for the ecosystem, all things considered.


Replies

hedgehog • today at 12:16 AM

I didn't touch JIT (complexity and footprint way beyond what I can use or manage myself in any case) but the AOT path is pretty much what you'd get if you wrote naive C by hand. The emitted code is readable, in some cases you probably do better because more efficient algorithms are easier to code or reuse, but with the current refcounting that will have some overhead. I do want to try some ideas like supporting an @soa decorator for a List of DataClass type that keeps the visible interface but changes the memory layout. If someone wanted to sponsor tokens I could probably pure robot through a stage of fleshing out enough to port a few representative libraries and tune against the results.