Chris Lattner
๐ค SpeakerAppearances Over Time
Podcast Appearances
You're not going to hurt my array.
Yeah.
Now, that is an interesting and very powerful design principle.
It defines away a ton of bugs.
You have to be careful to implement it in an efficient way.
Generally not, if you implement it the right way.
But it requires a lot of very low-level getting the language right bits.
Well, the trick is you can't do copies.
So you have to provide the behavior of copying without doing the copy.
Yeah, how do you do that?
How do you do that?
It's not magic.
It's just, it's actually pretty cool.
Well, so first, before we talk about how that works, let's talk about how it works in Python, right?
So in Python, you define a person class, or maybe a person class is a bad idea.
You define a database class, right?
And a database class has an array of records, something like that, right?
And so the problem is that if you pass in a record or a class instance into the database, it'll take a hold of that object, and then it assumes it has it.
And if you're passing an object in, you have to know that that database is gonna take it, and therefore you shouldn't change it after you put it in the database, right?
This is the problem.