Anders Hejlsberg
๐ค SpeakerAppearances Over Time
Podcast Appearances
Well, that means we need to know what is the type of the thing you dotted on.
In order to figure that out, we may have to resolve stuff.
We may have to look at ASTs over here and whatever.
And all of that has to happen within 200 milliseconds or else people think the IDE is slow, right?
Well, what if you have...
500,000 lines of code, you can't compile all of those in 200 milliseconds.
So you got to be super, super deferred and interactive.
And so you got to do minimal amounts of work.
And that's how our compiler is built is it tries to front load.
Like for example, like you have 500,000 lines of code.
Well, let's say in 500 files.
Well, we could build the ASTs for 499 of the files and just sit on them.
We don't have to rebuild those because you're not editing in those files.
We just have to update the AST of the current file you're in.
So that goes 500 times faster, right, than if we had to do all of it.
And then we don't actually have to figure out all of the types in here either.
We can just start
where you're at, and then just resolve just enough to answer the question that you're needing an answer for right now.
And so everything is lazy and deferred and functional and reusable inside the compiler.
And it's a very different way of writing compilers than what the textbooks will traditionally teach you.