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

Isn't the Python interpreter implemented in C? How could Python run someplace that C can't?


I think he means the exact same Python script can be run directly on any environment that has Python installed if written correctly, in contrast to a C program which has to be recompiled on various environments to be able to run.


One of them is. And ability to interpret Python is requirement for any python program to be able to run. Being able to build and deploy a c lib is not.

So, someone has made python run on Foo platform, lets say a watch. If I have a pure python program I can run it on that watch with no more fuss. If I have to rely on a c library then I have to get that ported to Foo platform, maybe dealing with developer keys and making "authorized" signed binary, etc, etc. Pure python is orders of magnitude easier.

That is why "Pure Python" is a thing.

Several standard libs come in pure python and C versions cause pure python is an advantage / requirement for some use cases. And speed is for others.


Python as a language is implemented on almost every platform out there- You can just take this source code and run it there, instead of compiling for the target hardware.




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

Search: