Codename: Roslyn

3,423 views

Published on

This is an early look at Roslyn

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,423
On SlideShare
0
From Embeds
0
Number of Embeds
1,439
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Mono: C:\\Program Files (x86)\\Mono-2.8\\bin\\gsharp
  • Codename: Roslyn

    1. 1. Setup<br />Visual Studio with Roslyn demo<br />C:Program Files (x86)Mono-2.8bincsharp.bat<br />ZoomIt<br />
    2. 2. WARNING: NOT A NORMAL DEV4DEVS TALK<br />Codename ‘Roslyn’ <br />robertmaclean<br />www.sadev.co.za ∞ @rmaclean ∞ robert@sadev.co.za<br />
    3. 3. What is ‘Roslyn’?<br />Project that will deliver the new VB & C♯ compilers and language services<br />
    4. 4. C♯ Compiler Themes<br />C♯ 1.0 : New language for a new platform<br />C♯ 2.0 : Generics, strong typing<br />C♯ 3.0 : Declarative programming<br />C♯ 4: Dynamic programming<br />C♯ “5” : Asynchronous programming<br />Note : <br />C♯ themes != .NET Framework themes<br />C♯ releases != .NET Framework releases<br />C♯ “5” is not an official name<br />
    5. 5. Problem with current compiler<br />Can’t consume from managed code<br /><ul><li>Add on developers re-develop the compiler
    6. 6. PowerShell re-develops the compiler
    7. 7. Visual Studio re-developed the compiler</li></ul>.NET Assemblies<br />Source Files<br />Compiler<br />(C++)<br />
    8. 8. Roslyn opens the box <br />Compiler API<br />REPL <br />(Read-Eval-Print-Loop)<br />Hosting in other contexts<br />.NET Assemblies<br />Source Files<br />Compiler<br />C# for C#<br />VB for VB<br />
    9. 9. What do we get with Roslyn?<br />Managed Compiler<br />VB compiler written in VB<br />C♯ compiler written in C♯<br />Compiler API<br />REPL Environment<br />“Interactive Window” <br />
    10. 10. Compiler API?<br />Syntax Tree<br />Emit API<br />Source Code<br />Compiler API<br />Symbol API<br />Binding & Flow API<br />
    11. 11. Syntax Tree - Nodes<br />class C<br />{<br />void M()<br />{<br />}<br />} // C<br />❏<br />CompilationUnit<br />TypeDeclaration<br />MethodDeclaration<br />ParameterList<br />Block<br />
    12. 12. Syntax Tree - Tokens<br />class C<br />{<br />void M()<br />{<br />}<br />} // C<br />❏<br />CompilationUnit<br />TypeDeclaration<br />EOF<br />MethodDeclaration<br />class<br />C<br />{<br />}<br />ParameterList<br />void<br />Block<br />M<br />(<br />)<br />{<br />}<br />
    13. 13. Syntax Tree - Trivia<br />class C<br />{<br />void M()<br />{<br />}<br />} // C<br />❏<br />CompilationUnit<br />TypeDeclaration<br />EOF<br />MethodDeclaration<br />class<br />C<br />{<br />}<br />nbsp<br />EOL<br />EOL<br />//C<br />EOL<br />ParameterList<br />void<br />nbsp<br />Block<br />nbsp.4<br />M<br />(<br />)<br />EOL<br />nbsp.4<br />{<br />EOL<br />nbsp.4<br />}<br />EOL<br />
    14. 14. Where does Compiler API take us?<br />Binding & Flow API<br />Symbol API<br />Syntax Tree<br />What the IDE understands == The compiler understands<br />
    15. 15. What about use normal developers?<br />Where would a Dev4Dev’s talk be without a demo?<br />Problem – NO ROSLYN BITS ARE PUBLIC!<br />Mono to the rescue!<br />
    16. 16. When will see ‘Roslyn’ then?<br />Currently in development<br />V1 features locked down<br />Been around building 41 since at least 2008 <br />Nothing official<br />19 July 2011 - Karen Ng: “To some degree, soon”<br />API out BEFORE product<br />
    17. 17. Sources and further reading<br />Get slides & demos at www.sadev.co.za<br />http://stackoverflow.com/questions/4222524/what-would-you-do-with-compiler-as-a-service<br />http://codebetter.com/patricksmacchia/2010/05/31/c-5-and-meta-programming/<br />http://research.microsoft.com/en-us/events/fs2011<br />http://social.msdn.microsoft.com/Forums/en-US/async/thread/03a51936-b4fd-4814-9161-46544eda63cf/<br />http://blogs.msdn.com/b/ericlippert/archive/2010/12/16/hiring-for-roslyn.aspx<br />http://blog.functionalfun.net/2008/10/dynamic-future-of-c-40.html<br />http://channel9.msdn.com/Shows/Checking-In-with-Erik-Meijer/Checking-In-Eric-Lippert-On-Compiler-Evolution-Designing-C-and-Blogging<br />http://castroller.com/Podcasts/NetRocks/2230612-Eric%20Lippert%20Talks%20About%20Project%20Roslyn<br />http://channel9.msdn.com/Shows/Going+Deep/Anders-Hejlsberg-Questions-and-Answers<br />http://blogs.msdn.com/b/lisa/archive/2011/03/29/teched-middle-east-2011.aspx<br />http://www.mono-project.com/CsharpRepl<br />http://www.sharpcrafters.com<br />
    18. 18. Questions?<br />

    ×