HackerTube

Anders Hejlsberg on Modern Compiler Construction

KasperRecommended by 4 HN commenters across 4 months, 2018–2023
YouTube
lecture · intermediate · evergreen · 2018–2023 on HN

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.

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

10 comments from Hacker News

@vector_spaces2020-12 · in “Advanced Compilers: Self-Guided Online Course”

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 years working on thing that's tangentially related to compilers" to being able to be productive in a reasonable amount of time working with the new architecture. What am I missing? ▶ this video

Recommends View on HN
@robocat2020-04 · in “Rust-analyzer – an IDE backend for Rust”

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: ▶ this video

Recommends View on HN
@atombender2020-02 · in “Rust Moving Towards an IDE-Friendly Compiler with Rust Analyzer”

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, adding a comment shouldn't need to recompile anything at all, merely modify the AST, because it doesn't lead to any actual code artifacts. The second benefit is that all the information needed to inspect the program — from syntax highlighting to type information — is already there. If you can keep the entire high-level compilation state in memory, then it's easy to query it for all sorts of IDE features. This same design was used for the TypeScript compiler. Anders Heljsberg has a great little lecture [2] about it. [1] link [2] ▶ this video

Recommends View on HN
@ceronman2018-12 · in “Rust Analyzer in 2018 and 2019”

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: ▶ this video

Recommends View on HN
@sarosh2023-06 · in “”

A (now 6 year old) discussion that might be helpful: Anders Hejlsberg on Modern Compiler Construction: ▶ this video Also link