Hacker News new | ask | show | jobs
by chrisseaton 3643 days ago
Why is a simple CPython implementation such an important requirement?

Portability? Make the JIT optional.

Ease of maintenance? Get a small team of experts to maintain it on behalf of everyone else.

Openness to beginners? That would be nice if possible as well, but CPython's job is to run programs rather than to educate.

A JIT needn't make the grammar, bytecode or threading model more complex. It would make data structures and the implementation more complex, but do you not think that's worth it if Python could be twice as fast?

1 comments

> CPython's job is to run programs rather than to educate.

CPythons 'job' is to be the reference implementation of Python.

But that's just not the case in reality is it? In reality it's the main production implementation and its inefficiency costs the world wasted resources every day.

If readability and being the reference implementation is more important than performance, why is Python implemented in C rather than a higher level language?

> In reality it's the main production implementation and its inefficiency costs the world wasted resources every day.

Sure, but the inefficiencies in every part of the stack from the physical CPU right up to the executing program also cause waste.

> If readability and being the reference implementation is more important than performance, why is Python implemented in C rather than a higher level language?

Because like most projects it grew organically. Guido didn't sit down and write the first version of Python and think "hey, this is going to be the reference implementation for Python so lets write it in pure pseudocode so it's easy to read", he bashed out a version in C and it gained momentum over time. At the point where it became the reference implementation rather than the only implementation it would be suicide to chuck it out and re-write it in some high level language.