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

Lex Fridman Podcast

#341 – Guido van Rossum: Python and the Future of Programming

26 Nov 2022

3h 22m duration
28124 words
3 speakers
26 Nov 2022
Description

Guido van Rossum is the creator of Python programming language. Please support this podcast by checking out our sponsors: - GiveDirectly: https://givedirectly.org/lex to get gift matched up to $1000 - Eight Sleep: https://www.eightsleep.com/lex to get special savings - Fundrise: https://fundrise.com/lex - InsideTracker: https://insidetracker.com/lex to get 20% off - Athletic Greens: https://athleticgreens.com/lex to get 1 month of fish oil EPISODE LINKS: Guido's Twitter: https://twitter.com/gvanrossum Guido's Website: https://gvanrossum.github.io/ Python's Website: https://python.org PODCAST INFO: Podcast website: https://lexfridman.com/podcast Apple Podcasts: https://apple.co/2lwqZIr Spotify: https://spoti.fi/2nEwCF8 RSS: https://lexfridman.com/feed/podcast/ YouTube Full Episodes: https://youtube.com/lexfridman YouTube Clips: https://youtube.com/lexclips SUPPORT & CONNECT: - Check out the sponsors above, it's the best way to support this podcast - Support on Patreon: https://www.patreon.com/lexfridman - Twitter: https://twitter.com/lexfridman - Instagram: https://www.instagram.com/lexfridman - LinkedIn: https://www.linkedin.com/in/lexfridman - Facebook: https://www.facebook.com/lexfridman - Medium: https://medium.com/@lexfridman OUTLINE: Here's the timestamps for the episode. On some podcast players you should be able to click the timestamp to jump to that time. (00:00) - Introduction (07:26) - CPython (12:38) - Code readability (17:00) - Indentation (33:36) - Bugs (45:04) - Programming fads (1:00:15) - Speed of Python 3.11 (1:25:09) - Type hinting (1:30:27) - mypy (1:35:43) - TypeScript vs JavaScript (1:51:42) - Best IDE for Python (2:01:43) - Parallelism (2:19:36) - Global Interpreter Lock (GIL) (2:29:14) - Python 4.0 (2:41:31) - Machine learning (2:51:13) - Benevolent Dictator for Life (BDFL) (3:02:49) - Advice for beginners (3:09:21) - GitHub Copilot (3:12:47) - Future of Python

Audio
Transcription

Chapter 1: What is discussed at the start of this section?

0.031 - 21.24 Unknown

The following is a conversation with Guido van Rossum, his second time on this podcast. He is the creator of the Python programming language and is Python's emeritus BDFL, benevolent dictator for life. And now a quick few second mention of each sponsor. Check them out in the description. It's the best way to support this podcast.

0

21.701 - 44.957 Unknown

We got GiveDirectly for philanthropy, 8sleep for naps, Fundrise for real estate investing, Insight Tracker for biodata, and Athletic Greens for nutritional health. Choose wisely, my friends. And now onto the full ad reads. As always, no ads in the middle. I try to make these interesting, but if you skip them, please still check out our sponsors. I enjoy their stuff. Maybe you will too.

0

46.659 - 73.6 Unknown

This show is brought to you by GiveDirectly, a nonprofit that lets you send cash directly to the people that need it. GiveDirectly donors include previous guests of this podcast, Jack Dorsey, Elon Musk, Metallic Buterin, all of whom happen to be Actually, not Jack. Jack only has been on once. But I'm pretty sure he's going to be on again many more times. He's a fascinating human being.

0

73.84 - 99.525 Unknown

Anyway, Elon too. He'll be back on soon. And of course, Vitalik as well, after the merge. Anyway, all of that to say that the idea of giving directly to the people that need it is actually a really powerful way to help people. There's a lot of science, there's a lot of studies behind it that show that getting cash directly to the people that need it is actually the best way to help them.

0

99.946 - 117.231 Unknown

So I think a lot of philanthropy is based on the idea that you could have a lot of middlemen and you kind of fund that chain that's able to optimally redistribute the funding. And okay, there might be some interesting aspects to that idea, but what I think is especially interesting is that

117.211 - 144.828 Unknown

when you remove all of those middlemen and you give directly to the people that need it, is actually really effective. I frankly love that idea. You can visit givedirectly.org to learn more and send cash directly to someone living in extreme poverty. That's givedirectly.org. This episode is also brought to you by Eight Sleep and its new Pod 3 mattress. I love taking naps.

145.389 - 163.738 Unknown

I got very little sleep last night. I just had a crazy pile of tasks to finish, and I had a crazy busy day today. So after I'm done recording these very words that I'm speaking to you, I'm going to go lay down on an Eight Sleep bed.

163.718 - 192.763 Unknown

cold mattress, warm blanket, and I'm going to pass out for 20, 25, 30 minutes, and I'm going to, as opposed to feeling a little bit tired, a little bit mentally exhausted, you know, maybe a little bit not so motivated to do work, I'm going to feel like a new human being, excited to get right back into the trenches of programming and taking on the rest of the day.

192.743 - 222.14 Unknown

just powering through, super productive. All of that, thank you to a comfortable, enriching, joyful nap. Check it out and get special holiday savings of up to $400 when you go to 8sleep.com slash Lex. This episode is also brought to you by Fundrise, spelled F-U-N-D-R-I-S-E. It's a platform that allows you to invest in private real estate.

Chapter 2: What are the key features of CPython?

2550.743 - 2556.45 Unknown

And you forgot to initialize whatever, some counter or some basic variable they're using.

0

2556.57 - 2557.931 Guido van Rossum

I can tell that you've coded.

0

2558.672 - 2583.763 Unknown

Yes. By the way, I should mention that I use a Kinesis keyboard. which has the backspace under the thumb. And one of the biggest reasons I use that keyboard is because you realize in order to use the backspace on a usual keyboard, you have to stretch your pinky out. And like, for most normal keyboards, the backspace is under the pinky.

0

2584.304 - 2597.805 Unknown

And so I don't know if people realize the pain they go through in their life because of the backspace key being so far away. So with the Kinesis, it's right under the thumb, so you don't have to actually move your hands. The backspace and the delete.

0

2597.785 - 2607.672 Guido van Rossum

What do you do if you're ever not with your own keyboard and you have to use someone else's PC keyboard that has that standard layout?

2608.113 - 2631.617 Unknown

So first of all, it turns out that you can actually go your whole life always having a keyboard. Well, except for that little tablet that you're using for note-taking right now, right? Yeah, so it's very inefficient note-taking, but I'm not. I'm just looking stuff up. But in most cases, I would be actually using the keyboard here right now. I just don't anticipate.

2631.637 - 2658.869 Unknown

You have to calculate how much typing do you anticipate. If I anticipate quite a bit, then I'll just... I have a keyboard. You pull it out. And same with... I mean, the embarrassing... I've accepted being the weirdo that I am, but when I go on an airplane and I anticipate to do programming or a lot of typing, I will have a laptop and I will pull out a Kinesis keyboard in addition to the laptop.

2659.329 - 2685.546 Unknown

And it's just who I am. You have to accept who you are. But also, for a lot of people, for me certainly, there's a comfort space that where there's a certain kind of setups that are, um, maximize productivity. And, um, it's like some people have a warm blanket that they like when they watch a movie. I like the Kinesis keyboard. It takes me to a place of focus.

2685.606 - 2717.404 Unknown

And I still mostly, I, I'm trying to make sure I use the state of the art IDs for everything, but my comfort place, just like the Kinesis keyboard is still Emacs. Yeah. I mean, that's some of the debates I have with myself about everything from a technology perspective. is how much to hold on to the tools you're comfortable with versus how much to invest in using modern tools.

Chapter 3: How does code readability impact programming?

4380.173 - 4409.623 Guido van Rossum

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.

0

4410.025 - 4434.058 Guido van Rossum

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.

0

4435.405 - 4456.815 Guido van Rossum

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. An object is basically a pointer to a bunch of memory that contains more pointers.

0

4457.035 - 4458.257 Unknown

Pointers all the way down.

0

4458.642 - 4484.513 Guido van Rossum

Well, not quite, but there are a lot of them. So to simplify a bit, we look up in one of the objects, what is the type of that object? And does that object type define an add operation? And so you can imagine that there is a sort of a type integer that knows how to add itself to another integer.

4485.255 - 4512.156 Guido van Rossum

And there is a type floating point number that knows how to add itself to another floating point number. And the integers and floating point numbers are sort of important, I think, mostly historically, because in the first computers, you used the sort of the same bit pattern when interpreted as a floating point number had a very different value than when interpreted as an integer.

4512.473 - 4536.729 Unknown

Can I ask a dumb question here? Please do. Given the basics of int and float and add, who carries the knowledge of how to add two integers? Is it the integer? It's the type integer versus... It's the type integer and the type float. What about the operator? Does the operator just exist as a platonic form possessed by the integer?

4537.29 - 4568.907 Guido van Rossum

The operator is more like... It's an index in a list of functions that the integer type defines. And so the integer type is really a collection of functions, and there is an add function, and there's a multiply function, and there are like 30 other functions for other operations. There's a power function, for example. And you can imagine that

4569.258 - 4594.692 Guido van Rossum

In memory, there is a distinct slot for the add operations. Let's say the add operation is the first operation of a type and the multiply is the second operation of a type. So now we take the integer type and we take the floating point type. In both cases, the add operation is the first slot and multiply is the second slot. But...

Chapter 4: What are the differences between TypeScript and JavaScript?

5713.737 - 5742.487 Guido van Rossum

The interesting thing in the JavaScript world, at least the web browser world, the web browsers have changed how they deploy and they sort of update their JavaScript engines much more quickly than they used to in the early days. And so there's much less of a need for transpilation in JavaScript itself, because most browsers just support the most recent version of ECMAScript.

0

5743.228 - 5750.939 Unknown

Just on a tangent of a tangent, do you see, if you were to recommend somebody use a thing, would you recommend TypeScript or JavaScript?

0

5752.02 - 5754.163 Guido van Rossum

I would recommend TypeScript.

0

5754.624 - 5756.687 Unknown

Just because of the strictness of the typing.

0

5756.988 - 5781.983 Guido van Rossum

It's an enormously helpful extra tool that helps you sort of keep your head straight about what your code is actually doing. I mean, it helps with editing your code. It helps with ensuring that your code is not too incorrect. And it's actually...

Chapter 5: How does MyPy relate to static typing in Python?

5782.857 - 5807.626 Guido van Rossum

quite compatible with JavaScript, never mind this syntactic sort of hack that is still years in the future. But any library that is written in pure JavaScript can still be used from TypeScript programs. And also the other way around, you can write a library in TypeScript and then export it in a form that is totally consumable by JavaScript.

0

5808.267 - 5814.315 Guido van Rossum

That sort of compatibility is sort of the key to the success of TypeScript.

0

5815.021 - 5821.607 Unknown

Yeah, just to look at it, it's almost like a biological system that's evolving. It's fascinating to see JavaScript evolve the way it does.

0

5822.207 - 5832.216 Guido van Rossum

Well, maybe we should consider that biological systems are just engineering systems too, right? Yes. Just very advanced with more history.

0

5833.097 - 5845.028 Unknown

But it's almost like the most visceral in the JavaScript world because there's just so much code written in JavaScript that for its history was...

Chapter 6: What challenges does the Global Interpreter Lock (GIL) present?

5845.008 - 5871.589 Unknown

messy if you talk about bugs per line of code i just feel like javascript eats the cake or whatever the terminology is it beats python by a lot in terms of number of bugs meaning like way more bugs in javascript and then and then the obviously the browsers are developing just there's so much active development it feels a lot more like evolution where a bunch of stuff is born and dies and there's experimentation and

0

5871.569 - 5889.048 Unknown

versus Python is more, all that stuff is happening, but there's just a longer history of stable working giant software systems written in Python, versus JavaScript is just a giant, beautiful, I would say, mess of code.

0

5889.068 - 5900.26 Guido van Rossum

It's a very different culture, and to some extent differences in culture are random, but to some extent the differences have to do with the environment. Yeah.

0

5900.24 - 5926.534 Guido van Rossum

And the fact that JavaScript is primarily the language for developing web applications, especially the client side, and the fact that it's basically the only language for developing web applications, makes that community sort of just have a different nature than the community of other languages.

0

5928.286 - 5948.415 Unknown

Plus the graphical component and the fact that they're deploying it on all kinds of shapes of screens and devices and all that kind of stuff. It just creates a beautiful chaos. Anyway, back to MyPy. So what, okay, you met, you talked about a syntax that could work. Where does it currently stand?

Chapter 7: What is the future of Python and its potential evolution?

5949.377 - 5951.56 Unknown

What's the future of static typing in Python?

0

5952.62 - 5960.075 Guido van Rossum

It is still controversial, but it is much more accepted than when MyPi and PEP484 were young.

0

5961.098 - 5965.507 Unknown

What's the connection between PEP484 type hints and MyPi?

0

5966.168 - 6003.761 Guido van Rossum

MyPi... was the original static type checker. MyPy quickly evolved from Yucca's own variant of Python to a static type checker for Python. And sort of PEP484, that was a very productive year where many hundreds of messages were exchanged, debating the merits of every aspect of that PEP. And so MyPy is a static type checker for Python. It is itself written in Python.

0

6004.942 - 6039.715 Guido van Rossum

Most additional static typing features that we introduced in the time since 3.6 were also prototyped through MyPy. MyPy being an open source project with a very small number of maintainers. It was successful enough that people said this static type checking stuff for Python is actually worth an investment for our company. Nice. But somehow they chose not to support Python.

6041.618 - 6066.478 Guido van Rossum

making MyPi faster, say, or adding new features to MyPi, but both Google and Facebook and later Microsoft developed their own static type checker. I think Facebook was one of the first. They decided that they wanted to use the same technology that they had successfully used for HHVM.

6068.551 - 6098.136 Guido van Rossum

because they had a bunch of compiler writers and static type checking experts who had written the HHVM compiler, and it was a big success within the company. And they had done it in a certain way. They wrote a big, highly parallel application in an obscure language named OCaml, which is apparently mostly very good for writing static type checkers.

6098.707 - 6105.479 Unknown

Interesting. I have a lot of questions about how to write a static type checker then. That's very confusing.

6105.579 - 6134.93 Guido van Rossum

Facebook wrote their version, and they worked on it in secret for about a year, and then they came clean and went open source. Google, in the meantime, was developing something called PyType, which was mostly... Interesting, because as you may have heard, they have one gigantic monorepo. So all the code is checked into a single repository. Facebook has a different approach.

Comments

There are no comments yet.

Please log in to write the first comment.