2. Agenda
• What is "Roslyn“
• Compiler-as-a-service paradigm
• How to get started
• Demo
• References, External links, etc.
• Q&A
3. What is “Roslyn”
• .NET Compiler Platform, better known by its
codename "Roslyn", is a set of open-source
compilers and code analysis APIs for C# and
Visual Basic.NET languages from Microsoft
• Compilers for the C# and Visual Basic.NET
languages exposed as services via APIs.
• APIs for code analysis and refactoring.
4. What is “Roslyn”
• CTP - Microsoft made a CTP available
for public download in October 2011. It
installs as an extension to Visual Studio
2010 SP1
• Preview - at the Build 2014 conference
in San Francisco April 2014, Microsoft
made the "Roslyn" project open-source
and released a preview of the language
integration for Visual Studio 2013
8. References
• .NET Compiler Platform ("Roslyn") on Codeplex
• Neil McAllister, Microsoft's Roslyn: Reinventing the
compiler as we know it, DEVELOPER_WORLD, 2011-10-20
• .NET Compiler Platform ("Roslyn") site, 2014-04-07
• "Roslyn project page", CodePlex
• .NET Foundation – Open Source Foundation for the .NET
Community
• "Microsoft "Roslyn" CTP", Microsoft Download Center
• "Microsoft "Roslyn" CTP", Microsoft Download Center
• "What's New in the Microsoft "Roslyn" September 2012
CTP", Visual Studio vNext Forums
• "Known Limitations and Unimplemented Language
Features", Visual Studio vNext Forums
9. External links
1. Official website for Microsoft "Roslyn" project
2. Introducing the Microsoft “Roslyn” CTP on the C#
Frequently Asked Questions MSDN blog
3. Throwing the Big Switch on Roslyn on the C#
Frequently Asked Questions MSDN blog
4. Roslyn at Codeplex
5. http://msdn.com/roslyn
When: 2011
Where: San-Francisco, “Build” Conference
Who: Anders Hejlsberg
.NET Compiler Platform, better known by its codename "Roslyn", is a set of open-source compilers and code analysis APIs forC# and Visual Basic.NET languages from Microsoft.[1]
The project notably includes self-hosting versions of the C# and VB.NET compilers – compilers written in the languages themselves. The compilers are available via the traditional command-line programs but also as APIs available natively from within .NET code. Roslyn exposes modules for syntactic (lexical) analysis of code, semantic analysis, dynamic compilation to CIL, and code emission.[2]
Roslyn is currently available as a preview for Visual Studio
The CTP was updated on September 2012.[7] The September 2012 CTP includes many updates to the Roslyn APIs
introduced in the June 2012 and October 2011 CTPs, including breaking changes.
While the June 2012 CTP API is complete for the compilers,
not all features have been implemented for the C# and VB.NET languages.
At the Build 2014 conference in San Francisco April 2014, Microsoft made the "Roslyn" project open-source
and released a preview of the language integration for Visual Studio 2013. At the same conference,
Xamarin announced that they are working on integrating the new compilers and tools in Xamarin Studio.
The compilers are not feature complete in this release. Each of the compilers contains features that
are planned for the coming language versions (C# 6 and Visual Basic.NET 13).
The APIs are also available through the NuGet package manager.
What exactly does Compiler as a Service (CaaS) mean in relation to Roslyn? You can watch a video where Anders Hejlsberg explains that (talk about Roslyn starts at 35 minutes in). Basically, the old C# compiler is a "black box": source code comes in, compiled assemblies come out. Roslyn gives you access inside that box. That means you can get syntactic and semantic information about some code, modify it and give it back to the compiler to process it further. You can use that to do code analysis, refactoring, code generation and more.
SyntaxTree (Formatter, Colorizer, Outlining)
Emit API (Edit And Continue, Read-Eval-Print-Loop aka інтерактивне C#-вікно, C# scripts)
Symbol API (Object Browser, Navigate To)
Binding & Flow Analysis API (Go To Definition, Extract Method, Signature Help, Quick Info, Rename, Find All References, Completion List)
Compiler pipeline: Parser > Symbols load/Metadata Import/Binder/IL Emiter
Available since MS VS 2010 SP1 as CTP
Available as a part of MS VS 2014
Available via NuGet package manager
Install-Package Microsoft.CodeAnalysis –Pre
http://msdn.microsoft.com/ru-ru/vstudio/roslyn.aspx