Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Think of Python as a way to script C, and skip most/all compiling. If your Python is slow, you are probably doing it wrong.

Recommend reading this: https://cerfacs.fr/coop/fortran-vs-python



I was a teaching assistant in a "data structures and algorithms" course where students could choose either Java or Python. Most of the labs were the same except that the treemap lab had to become a hashmap lab for the Python version because it was so excruciatingly slow.


Not all Python is just a front-end to fast C code. That only really works with numerical computing of big tensors.

Though I'd still agree - if your Python is slow you're doing it wrong - you shouldn't be using Python!


You can also call eg Rust or OCaml code from Python, doesn't have to be C.


Of course. When people talk about calling C from Python they really mean "a fast language".


If you switch away from Python, you are probably sub optimizing


There are reasons other than speed that makes people move away from Python.

Btw, recently CPython has sped up a lot. Between versions 3.9 to 3.12 many programs run about twice as fast. Much of that improvement is thanks to the 'faster-cpython' project (which Microsoft is generously funding).

I contributed about a 1% speedup during that time, too.


If you want to see C's _true_ scripting language, check out Lua.

It can be embedded in your C application, unlike Python which is the other way around (Lua is like 80KiB, Python is several MiB).




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: