Anders Hejlsberg on Modern Compiler Construction

Channel:Kasper · Length:34:09 · Published:2017-01-31 · Views:25419

Watch on YouTube

Summary

Anders Hejlsberg whiteboards how compilers are taught versus how modern ones are actually built. He explains the shift to compilers as services with incremental, error-tolerant, IDE-oriented design, as in Roslyn and TypeScript.

Why HN recommends it

It is the standard reference for why modern compilers and language servers differ from textbook designs, cited in rust-analyzer and parsing threads.

I really recommend this video from Anders Hejlsberg (creator of C# and TypeScript) — HN, 2018

Compilers, interpreters & program analysis · Testing, debugging & developer tools · Tech pioneers & interviews

Subtitles (excerpt)

Hey there, this is Seth Wars from Channel 9 coming to you from building 17 and I'm here with the great Anders Hellsburg who not only writes languages but is a master twister player from what I understand. How you doing my friend? I'm I'm good. Yourself? So we met we I saw you in the lunchroom and we had we were talking about compilers, right? Because it's something you like. And you said something interesting to me that I thought we should talk about. You said because when I went to school we used this book. That's right. Well, when I did, we did too. I mean, this is the book that you use, right? It was published 30 years ago, and you told me we don't even do it that way anymore. Or you do, but there's some stuff that's changed, right? Right. I mean, it's it's, you know, compilers have I mean, a long storyried history, right? I mean, that book is we were just looking it's 30 years old or the first edition was published 30 years ago. Mhm. And you know it's a slowmoving art but but over the last I don't know decade or so um we've become very accustomed to very intelligent uh idees and development tools and we've been we've become accustomed to features like statement completion and refactoring and go to definition

On Hacker News

I saw this great interview recently with Anders Hejlsberg at MSFT on how modern compiler construction differs from what is taught in traditional University courses. Is this what you're alluding to? After watching that interview, it's strange to read a comment like yours. While the architecture is completely different, it doesn't frankly seem like that big a leap to go from "senior engineer with X… — vector_spaces, 2020-12
Anders Hejlsberg explains explains how “the IDE” way compiler works. First ~10 minutes is traditional compiler background. Then about ~8 minutes before he starts talking about how an IDE focused compiler works: [VIDEO] — robocat, 2020-04
Microsoft's Roslyn [1] design (now called .NET Compiler Platform) is what I think any language should strive for, turning the classical black box of the compiler into an incremental pipeline where each stage is annotated/augmented/refined by different mechanisms such as type checkers. If each step is incremental, it follows that it's easier to also let each step "integrate" deltas; for example, a… — atombender, 2020-02
To better understand why this project is trying to re-implement the compiler frontend, I really recommend this video from Anders Hejlsberg (creator of C# and TypeScript) explaining how modern compiler construction oriented towards IDE works: [VIDEO] — ceronman, 2018-12
A (now 6 year old) discussion that might be helpful: Anders Hejlsberg on Modern Compiler Construction: [VIDEO] Also [LINK] — sarosh, 2023-06

Related videos