8. Roslyn opens the box Compiler API REPL (Read-Eval-Print-Loop) Hosting in other contexts .NET Assemblies Source Files Compiler C# for C# VB for VB
9. What do we get with Roslyn? Managed Compiler VB compiler written in VB C♯ compiler written in C♯ Compiler API REPL Environment “Interactive Window”
10. Compiler API? Syntax Tree Emit API Source Code Compiler API Symbol API Binding & Flow API
11. Syntax Tree - Nodes class C { void M() { } } // C ❏ CompilationUnit TypeDeclaration MethodDeclaration ParameterList Block
12. Syntax Tree - Tokens class C { void M() { } } // C ❏ CompilationUnit TypeDeclaration EOF MethodDeclaration class C { } ParameterList void Block M ( ) { }
13. Syntax Tree - Trivia class C { void M() { } } // C ❏ CompilationUnit TypeDeclaration EOF MethodDeclaration class C { } nbsp EOL EOL //C EOL ParameterList void nbsp Block nbsp.4 M ( ) EOL nbsp.4 { EOL nbsp.4 } EOL
14. Where does Compiler API take us? Binding & Flow API Symbol API Syntax Tree What the IDE understands == The compiler understands
15. What about use normal developers? Where would a Dev4Dev’s talk be without a demo? Problem – NO ROSLYN BITS ARE PUBLIC! Mono to the rescue!
16. When will see ‘Roslyn’ then? Currently in development V1 features locked down Been around building 41 since at least 2008 Nothing official 19 July 2011 - Karen Ng: “To some degree, soon” API out BEFORE product
17. Sources and further reading Get slides & demos at www.sadev.co.za http://stackoverflow.com/questions/4222524/what-would-you-do-with-compiler-as-a-service http://codebetter.com/patricksmacchia/2010/05/31/c-5-and-meta-programming/ http://research.microsoft.com/en-us/events/fs2011 http://social.msdn.microsoft.com/Forums/en-US/async/thread/03a51936-b4fd-4814-9161-46544eda63cf/ http://blogs.msdn.com/b/ericlippert/archive/2010/12/16/hiring-for-roslyn.aspx http://blog.functionalfun.net/2008/10/dynamic-future-of-c-40.html http://channel9.msdn.com/Shows/Checking-In-with-Erik-Meijer/Checking-In-Eric-Lippert-On-Compiler-Evolution-Designing-C-and-Blogging http://castroller.com/Podcasts/NetRocks/2230612-Eric%20Lippert%20Talks%20About%20Project%20Roslyn http://channel9.msdn.com/Shows/Going+Deep/Anders-Hejlsberg-Questions-and-Answers http://blogs.msdn.com/b/lisa/archive/2011/03/29/teched-middle-east-2011.aspx http://www.mono-project.com/CsharpRepl http://www.sharpcrafters.com