Why is python not written in C++ ?

Carl Banks pavlovevidence at gmail.com
Tue Aug 3 18:56:17 EDT 2010


On Aug 3, 3:19 pm, John Bokma <j... at castleamber.com> wrote:
> Carl Banks <pavlovevide... at gmail.com> writes:
> > On Aug 3, 2:29 am, John Bokma <j... at castleamber.com> wrote:
>
> [..]
>
> >> But they call both the C libraries in the same way.
>
> > Go look at the original claim, the one that you responded to.  "It's
> > much easier to distribute C libraries than C++ libraries."
>
> Yup, and if I read it correctly the claim was: and that's why C++ was
> not chosen. I doubt it.

I think it was.  Not necessarily that GvR made a list of reasons to
choose C over C++.  But the fact that C++ has almost no
interoperability between compilers except via regular C linkage is a
major cultural reason why it's avoided for programs that need
extensible APIs like Python, which is why language implementors try to
avoid it.

The availability of C++ fronts that translate to C isn't the slightest
bit relevant to this.


> > Hence, "It's much easier to distribute C libraries than C++
> > libraries."
>
> Yup, but still doesn't exclude C++ from being used to implement a
> programming language.

Well, if you want to write a language that people can write extensions
for using something other than the same C++ compiler you used, then
your only option is to use "C" external linkage which means that
whatever OOP advantages C++ gives you aren't going to be available to
extensions.

This is true even if you use a C++ front instead of a compiler.


Carl Banks



More information about the Python-list mailing list