Guido van Rossum
๐ค SpeakerAppearances Over Time
Podcast Appearances
What's a just-in-time compiler?
That is a thing from the Java world, although it's now applied to almost all programming languages, especially interpreted ones.
We changed some parts of the bytecode, but not very much.
And so we only had to change the parts of the compiler where we decided that the breakdown of a Python program in bytecode instructions had to be slightly different.
But that didn't gain us...
the performance improvements.
The performance improvements were like making the interpreter faster in part by sort of removing the fat from some internal data structures used by the interpreter.
But the key idea is an adaptive specializing interpreter.
Well, let me first talk about the specializing part because the adaptive part is the sort of the second order effect, but they're both important.
So bytecode is a bunch of machine instructions, but it's an imaginary machine.
But the machine can do things like call a function, add two numbers, print a value.
Those are sort of typical instructions in Python.
And if we take the example of adding two numbers, actually in Python, the language, there's no such thing as adding two numbers.
The compiler doesn't know that you're adding two numbers.
You might as well be adding two strings or two lists or two instances of some user-defined class that happened to implement this operator called add.
That's a very interesting and fairly powerful mathematical concept.
It's mostly a user interface trick because it means that a certain category of functions can be written using a single symbol, the plus sign.
And sort of a bunch of other functions can be written using another single symbol, the multiply sign.
So if we take addition, the way traditionally in Python the add bytecode was executed is pointers, pointers, and more pointers.
So first we have two objects.