Pages

Sunday, October 20, 2013

Roslyn CTP

What is Roslyn?
Microsoft compilers have been always acting as black boxes. You provide the source text in and out the other end, you receive an assembly. All of that rich knowledge and information that the compiler produces is thrown away and unavailable for anyone else to use.
Visual Studio team has recently been working on a project called Roslyn with a goal to rewrite the C# and VB compilers and language services in managed code. This means that Microsoft is opening up the C# and Visual Basic compilers and exposing all that rich information and code analysis to be available for the software developers. Microsoft exposes a public API surface and provide extension points in the C# and VB language services. This opens up new opportunities for VS extenders to write powerful refactorings and language analysis tools, as well as allow anyone to incorporate Microsoft parsers, semantic engines, code generators and scripting in their own applications.
The Community Technological Preview (CTP) version can be downloaded from Roslyn CTP
Getting Started
After installing the Roslyn CTP, the best place to start is to open Start Menu -> Microsoft Codename Roslyn CTP -> Getting Started.
The CTP ships with quite a few samples for Visual Studio Extensions, compiler API, code issues, refactorings and so on. Most of the samples are provided for both C# and Visual Basic. You can open the sample source code from the Getting Started page.
In addition, several new project templates are available in the New Project dialog:

You can run scripts using the new rcsi.exe, which installs into %ProgramFiles(x86)%\Microsoft Codename Roslyn CTP\Binaries\rcsi.exe. You can add rcsi.exe to the path and then type rcsi .csx.
You can also copy chunks of code from a script file and send them to the C# Interactive Window (using the right-click context menu or a keyboard shortcut).

No comments:

Post a Comment