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

Chris Lattner

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

Appearances Over Time

Podcast Appearances

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

Now, if I got past an integer, do some dynamic tests for it.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

If it's a string, go do another thing.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

There's another additional challenge, which is even if you did support overloading, you're saying, okay, well, here's a version of a function for integers and a function for strings.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

Well, even if you could put it in that dictionary, you'd have to have the caller do the dispatch.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

And so every time you call the function, you'd have to say, like, is it an integer or is it a string?

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

And so you'd have to figure out where to do that test.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

And so in a dynamic language, overloading is something you don't have to have.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

But now you get into a type language and, you know, in Python, if you subscript with an integer, then you get typically one element out of a collection.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

If you subscript with a range, you get a different thing out, right?

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

And so often in type languages, you'll want to be able to express the fact that, cool, I have different behavior depending on what I actually pass into this thing.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

If you can model that, it can make it safer and more predictable and faster and like all these things.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

Yeah, well, this is also one of the challenges with the existing Python typing systems is that in practice, like you take subscript, like in practice, a lot of these functions, they don't have one signature.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

They actually have different behavior in different cases.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

And so this is why it's difficult to retrofit this into existing Python code and make it play well with typing.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

You kind of have to design for that.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

So here you get into what is the trade-off with the superset?

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

Okay.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

So superset, you have to, or you really want to be compatible.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

You've like, if you're doing a superset, you've decided compatibility with existing code is the important thing.

Lex Fridman Podcast
#381 โ€“ Chris Lattner: Future of Programming and AI

Even if some of the decisions they made were maybe not what you choose.