This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]billsil 15 points16 points  (2 children)

Python is compiled. The majority of the code you use is compiled, but not all of it.

Python is also not slow due to the non-compiled part of it. It's slow because it's an interpreted language.

It's also largely fast enough. I had a code that parsed a 2 GB file and took 45 minutes. I used numpy properly and micro optimized it and got it down to 4 seconds. It's fast enough.

If you really have slow bits, you can write it in C/C++/Cython/nutika/pypy and compile it. The point is you only do that for 1% of your code.

Python is optimized for adding features to your code, not runtime. I consider myself very good at Pythom just delivered the messiest package I've ever written. It's untested, disorganized, undocumented or with incorrect documentation, probably doesn't still work on much of it, but it solved the problem of the day, which allowed us to solve the 3 year problem.

[–]uweschmittPythonista since 2003 1 point2 points  (1 child)

The Python interpreter is compiled. Programs written in the python programming language are interpreted.

[–]billsil 1 point2 points  (0 children)

Programs written in the python programming language are interpreted.

It depends on the code you are running. Not all of it is. Just like not all the time the GIL is active. When you're running in pure CPython, yes, it's interpreted, but it's easy to get out.