Python source code, C is completely object, the package, polymorphism and other features have been implemented in C, then why not directly on C + +? This can also make the code more readable
Reply content:
See:
Why are Python written in C and not in C + +? / http programmers.stackexchange.com /questions/20988/why-is-python-written-in-c-and-not-in-c
1. CPython 1.0 was released in 1989, when C was just standardized and C + + was not known
2. C has better portability than C + +
3. Rewrite the code is a big project CPython why use C instead of C + + implementation, @ Heart Court's answer is already very clear.
As to today why not use C + + to implement Python, the main problem is to want Dropbox Pyston
Bai, the Python package, polymorphism, implemented by C + +, is not used in OOP language at all. The feature that must not be used in OOP language to be easily implemented is implementation inheritance (Implementation inheritance). So I say that people who love OO first look at your system to realize that the inheritance is not much. The reality is that there is no place in the UI framework that implements inheritance. From the Python source code implementation can be considered that Python and C + + is the C language of the object-oriented "extension", and their "extension" thinking is not the same, C + + is to minimize the performance of the loss, and python everything is to simplify the object's high-level view, So Python with C development does not need to go through C + + to the object-oriented understanding, directly with the bottom of the material according to their own ideas to build another high-rise buildings in many large C projects, have adopted or part of the idea of object-oriented, using C language to write some encapsulation and object-like encapsulation, This is just to better organize the whole project with object-oriented thinking. It's not that writing an object-oriented language requires another object-oriented language to implement.
There are a lot of language underlying is written in C, a lot of network libraries, network tools and so on. Personal Opinion:
1. The C language is closer to the underlying operating system and can be more coupled to the operating system (think why Linux does not write in C + +)
2. C Writing makes cross-platform better, same as View 1, the operating system is C write because CPython is too old, and CPython based on the use of the new architecture Pyston is implemented with C++11. The implementation of Python under Windows is called API, which is sufficient for C. MFC's words can only be used in C + +. Developing object-oriented languages with object-oriented language often lost