In article <roy-30c94b.20362001082...@news.panix.com>, Roy Smith <r...@panix.com> wrote: >In article <4c55fe82$0$9111$426a3...@news.free.fr>, > candide <cand...@free.invalid> wrote: > >> Python is an object oriented langage (OOL). The Python main >> implementation is written in pure and "old" C90. Is it for historical >> reasons? >> >> C is not an OOL and C++ strongly is. I wonder if it wouldn't be more >> suitable to implement an OOL with another one. > >One thing that comes to mind is that it's much easier to distribute C >libraries than C++ libraries. > >If I compile a main program with one C compiler and you compile a >dynamically loaded library with another C compiler on the same box, the >odds are pretty good they'll interoperate without any problems. > >Not at all so with C++ compilers. The linkage is *way* more >complicated. Not just how the two compilers do name mangling, but how >they handle exceptions, RVO, and a zillion other details. Pretty much >the only way to make it work is to compile everything with exactly the >same compiler. That would make it pretty close to impossible for people >to take a Python core distribution and add their own extension modules >to it.
We had a similar discussion on comp.lang.forth. The bottom line is that to implement a programming language you want to use a simpler programming language, not a more complicated one. Then there is a secondary requirement, that language must allow sufficient access to low level features to allow decent performance. A third aspect is that Linux/Unices as well as Windows assume OS interaction in terms of c-libraries. Any intermediary is inconvenient at least. Or in one catch phrase: " To implement a programming language you need a high level assembler like C." (We went on whether Forth would be a suitable high level assembler for Haskell. It would beat C++ -- not C -- for implementing Python, that much I'm sure.) Undoubtedly C is the right choice to implement Python. Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. alb...@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst -- http://mail.python.org/mailman/listinfo/python-list