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

Anders Hejlsberg

๐Ÿ‘ค Speaker
701 total appearances

Appearances Over Time

Podcast Appearances

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

Well, that means we need to know what is the type of the thing you dotted on.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

In order to figure that out, we may have to resolve stuff.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

We may have to look at ASTs over here and whatever.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

And all of that has to happen within 200 milliseconds or else people think the IDE is slow, right?

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

Well, what if you have...

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

500,000 lines of code, you can't compile all of those in 200 milliseconds.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

So you got to be super, super deferred and interactive.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

And so you got to do minimal amounts of work.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

And that's how our compiler is built is it tries to front load.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

Like for example, like you have 500,000 lines of code.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

Well, let's say in 500 files.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

Well, we could build the ASTs for 499 of the files and just sit on them.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

We don't have to rebuild those because you're not editing in those files.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

We just have to update the AST of the current file you're in.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

So that goes 500 times faster, right, than if we had to do all of it.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

And then we don't actually have to figure out all of the types in here either.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

We can just start

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

where you're at, and then just resolve just enough to answer the question that you're needing an answer for right now.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

And so everything is lazy and deferred and functional and reusable inside the compiler.

The Pragmatic Engineer
TypeScript, C# and Turbo Pascal with Anders Hejlsberg

And it's a very different way of writing compilers than what the textbooks will traditionally teach you.