© Nick Harrison 2017

Nick Harrison, Code Generation with Roslyn, 10.1007/978-1-4842-2211-9_4

4. An Introduction to Roslyn

Nick Harrison

(1)Lexington, South Carolina, USA

Roslyn is the new compiler from Microsoft. It represents not only a rewrite of the compilers but also a reimagining of the compilation process in general. In the past, compiling code was a black box. Lines of code went in and a compiled assembly came out, or perhaps a slew of error messages. You could not interrupt this process to get access to any of the intermediate steps. All this changed with Roslyn. Figure 4-1 shows the steps Roslyn takes to compile code and identifies the APIs used to interact with the results at each stage.

Figure 4-1. The Roslyn pipeline

The Roslyn Pipeline ...

Get Code Generation with Roslyn now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.