logoalt Hacker News

snovymgodym • yesterday at 6:51 PM • 3 replies • view on HN

It clearly isn't hurting Python's popularity, but man the performance of the reference implementation is embarrassing.

V8 made JavaScript fast in 2008, soon that will be 20 years ago.

Perhaps I live in a bubble, but so much of the production Python code I see is fully type-hinted and makes used of an aggressive linter & type checker to the point where it might as well be written in Go/C#/Java/TypeScript so that it can actually take advantage of the performance gains instead of being loaded into a runtime that turns everything into heap-allocated PyObject pointers.


Replies

joerick • today at 8:58 AM

I only just saw it mentioned in this thread, but CinderX might suit you well.

cpburns2009 • yesterday at 7:04 PM

This is exactly how I write my Python. I'm currently debating between going in deep and transitioning to either TypeScript or Rust. Go's object system and error handling is too weak. Java is too verbose, but I have a soft spot for it.

➕ show 3 replies
_old_dude_ • yesterday at 8:13 PM

If you want V8 like optimizations, you have to introduce a strict mode.

Python interpreter is known to leak its implementation (__class_ modification after creation, monkey patching with __getattr__, sys._getframe, eval/exec, deterministic call to __del__, no proper python API for libraries, etc.)

You have to plug all of those holes before having a chance to get a decent JIT. Otherwise it will be just another JIT attempt, like Psyco, Unladen Swallow, Pyston.

➕ show 1 reply