3 ms·
If you look the example code you will also immediately understand why Python is “slow”. Also for some easy performance gains Python should forfeit some of this
by miohtama 3y ago
If you look the example code you will also immediately understand why Python is “slow”. Also for some easy performance gains Python should forfeit some of this dynamism and optionality and just give types like int (no subclassing).
- contravariant 3y agoWhat would be nice is an official '@compile' decorator, but there already are a couple of attempts and none of them are (AFAIK) compelling enough to declare them the default.
- DistractionRect 3y agoI think the most compelling effort right now is Mojo [0]. Chris Lattner usually delivers, so I'm pretty bullish on Mojo. [0] https://news.ycombinator.com/item?id=35809658 https://news.ycombinator.com/item?id=35809658
- RyEgswuCsn 3y agoWell, there is always the option of C/C++...
- Spivak 3y agoUnfortunately subclassing int is actually used https://docs.python.org/3/library/enum.html#enum.IntEnum https://docs.python.org/3/library/enum.html#enum.IntEnum and worse Python's int is arbitrary precision so you couldn't compile it to a fixed size.
- tekknolagi 3y agoThis is the topic of the post if you keep reading :)