One of those “must watch” videos if you are remotely or more interested in how compilers influence our day to day coding activities.

The Red Dragon Book, first edition: Compilers. Principles, Techniques and Tools.
It starts out with referring to the Dragon Book (well, actually the first edition of the Red Dragon Book, as there are three) describing the compilers as having front-ends consisting of a Lexer, Parser and Type Checker and back-ends consisting of Code Generator and Emitter. A full compilation is going through all five stages and there is an increasing cost using these traditional stages when going from syntax highlighting via collapsible regions to red squiggles and code completion will need to go further along those stages taking an increasing time – like seconds or even longer – whereas the user experience requires responses in ~ 100 milliseconds where his code might not even compile in the first place.
Then Anders goes on describing Roslyn, TypeScript and Compiler API JSON interfaces to them so you can run them as a service and keep compiler state, rebuilding just enough of the state on source code changes. He goes on talking about how Visual Studio, Visual Studio Code, Command-Line Compiler, Sublime Text and other tools (can) use these APIs to interact with the compiler so it keeps state of slowly evolving code of which the tools than can emit what they need.
Anders explains this much better and much more visually than I do: so it’s a highly recommended video.
Read the rest of this entry »
Like this:
Like Loading...