Chris Lattner
π€ SpeakerAppearances Over Time
Podcast Appearances
So if you define X as a string, and then you have some use of X somewhere in your code.
Within that scope, you mean?
Within a scope that is accessible?
Yeah, exactly.
So you can only use something within its scope.
And so then it doesn't wait until the end of the scope to delete it.
It destroys it after the last use.
Yeah, and it's all in the compiler, so it's not at runtime, which is also cool.
And so, yeah, and so what, and this is actually non-trivial because you have control flow.
And so it gets complicated pretty quickly.
And so like getting this right was not.
Also you have to insert delete like in a lot of places.
Potentially, yeah, exactly.
So the compiler has to reason about this and this is where.
Again, it's experience building languages and not getting this right.
So again, you get another chance to do it and you get basic things like this, right?
But it's extremely powerful when you do that, right?
And so there's a bunch of things like that that kind of combine together.
And this comes back to the, you get a chance to do it the right way, do it the right way and make sure that every brick you put down is really good so that when you put more bricks on top of it, they stack up to something that's beautiful.
Well, so, I mean, let me give you another example of this.