Menu
Sign In Search Podcasts Charts People & Topics Add Podcast API Blog Pricing

Guido van Rossum

๐Ÿ‘ค Speaker
See mentions of this person in podcasts
1189 total appearances

Appearances Over Time

Podcast Appearances

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

data type, which again, interprets the bit pattern as the address of a sequence of characters.

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

There are lots of lies in that story, but that's...

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

That's sort of a basic idea.

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

I can tell.

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

The optimization is the observation that in a particular line of code, so now you write your little Python program.

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

and you write a function, and that function sort of takes a bunch of inputs, and at some point it adds two of the inputs together.

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

Now, I bet you even if you call your function a thousand times that all those calls are likely all going to be about integers, because maybe your program is all about integers.

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

Or maybe on that particular line of code where there's that plus operator,

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

Every time the program hits that line, the variables A and B that are being added together happen to be strings.

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

And so what we do is instead of having this single byte code that says, here's an add operation and the implementation of add is fully generic.

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

It looks at the object from the object, it looks at the type, then it takes the type and it looks up the function pointer, then it calls the function.

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

Now the function has to look at the other argument and it has to double check that the other argument has the right type.

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

And then there's a bunch of error checking before it can actually just go ahead and add the two bit patterns in the right way.

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

What we do is every time we execute an add instruction like that, we keep a little note of...

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

In the end, after we hit the code that did the addition for a particular type, what type was it?

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

And then after a few times through that code, if it's the same type all the time,

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

we say, oh, so this add operation, even though it's the generic add operation, it might as well be the add integer operation.

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

And the add integer operation is much more efficient because it just says, assume that A and B are integers, do the addition operation, do it right there in line and produce the result.

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

And the big lie here is that in Python, even if you have great evidence that in the past it was always two integers that you were adding, at some point in the future, that same line of code could still be hit with two floating points or two strings or maybe a string and an integer.

Lex Fridman Podcast
#341 โ€“ Guido van Rossum: Python and the Future of Programming

It's not a great lie.