3 ms·
"In practice, you don't get implementations of languages like...Python,...without C and C++." Unless someone takes the time to free Python from C, by doing som
by betterunix 14y ago
"In practice, you don't get implementations of languages like...Python,...without C and C++."
Unless someone takes the time to free Python from C, by doing something like this:
https://en.wikipedia.org/wiki/PyPy https://en.wikipedia.org/wiki/PyPy
Really, the reason you see interpreters being written in C/C++ has less to do with any technical quality of C or C++ and more to do with something else you mentioned:
"your software, regardless of the language it's written in, will likely be dealing with an OS written in C and/or C++,"
Bingo. Sometimes software needs to do low-level things, even if the software itself is high-level, and that means the software is probably going to be making system calls. An interpreter for Python is going to have to make some system calls, and it is much easier to do that if the interpreter is written in the same language as the OS's API; most OSes have C APIs, and thus writing a Python interpreter in C makes sense.
"These days, C and C++ are nearly inescapable when implementing real-world software."
I doubt it, considering how much real-world software is being written in Java, C#, Ruby, Javascript, etc. Not all software needs to do things that involve directly deal with the OS. The fact that these systems are often implemented in C does not make C inescapable; it just means that nobody has bothered to free themselves from C yet. There is no technical feature of C that makes it inescapable as a language, it is just what we have to deal with until we put in the effort needed to rid ourselves of it.