Menu
Sign In Search Podcasts Charts People & Topics Add Podcast API 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

This is usually the two design patterns.

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

If you look in PyTorch, for example, this is cloning a tensor.

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

Like there's a specific thing and you have to know where to call it.

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

And if you don't call it in the right place, you get these bugs and this is state of the art, right?

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

So a different approach, so it's used in many languages, so I've worked with it in Swift, is you say, okay, well, let's provide value semantics.

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

And so we want to provide the view that you get a logically independent copy, but we want to do that lazily.

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

And so what we do is we say, okay, if you pass something into a function, it doesn't actually make a copy.

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

What it actually does is it just increments a reference to it.

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

And if you pass it around, you stick it in your database, it can go in the database, you own it.

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

and then you come back out of the stack, nobody's copied anything, you come back out of the stack and then the caller lets go of it, well then you've just handed it off to the database, you've transferred it, and there's no copies made.

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

Now on the other hand, if your coworker goes and hands you a record and you pass it in, you stick it in the database, and then you go to town and you start modifying it, what happens is you get a copy lazily on demand.

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

And so what this does is gives you copies only when you need them.

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

And it also, so it defines away the bugs, but also generally reduces the number of copies in practice.

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

Yeah, so you need a couple of things.

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

So this concept has existed in many different worlds.

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

And again, it's not novel research at all.

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

The magic is getting the design right so that you can do this in a reasonable way.

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

And so there's a number of components that go into this.

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

One is when you're passing around.

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

So we're talking about Python and reference counting and the expense of doing that.