Jaa


Roslyn CTP Now Available

In my last few blog posts, I’ve highlighted significant advancements our teams have made as part of the Visual Studio 11 Developer Preview released at //BUILD/, and I’ll continue that series in future posts.  Today, however, I want to highlight some innovative work our teams have been doing that is even more forward looking.

I’m excited to announce that we’ve just released the Microsoft “Roslyn” CTP, which enables the C# and Visual Basic compilers to be used as a service.  While we’ve been busy working on C# 5 and Visual Basic 11, via Roslyn we’ve been working concurrently on a complete rewrite of the C# and Visual Basic compilers.  Whereas today’s compilers are implemented in native C++, in Roslyn we’ve rewritten the compilers from the ground up, implementing the C# compiler in C# and the Visual Basic compiler in Visual Basic.  That in and of itself isn’t entirely noteworthy, as it’s long been a tradition for a language compiler to be implemented in its target language, something that’s been true of both our F# and Visual C++ compilers.  What’s quite noteworthy are the scenarios and services this work enables.

Historically, the managed compilers we’ve shipped in Visual Studio have been opaque boxes: you provide source files, and they churn those files into output assemblies.  Developers haven’t been privy to the intermediate knowledge that the compiler itself generates as part of the compilation process, and yet such rich data is incredibly valuable for building the kinds of higher-level services and tools we’ve come to expect in modern day development environments like Visual Studio.

With these compiler rewrites, the Roslyn compilers become services exposed for general consumption, with all of that internal compiler-discovered knowledge made available for developers and their tools to harness.  The stages of the compiler for parsing, for doing semantic analysis, for binding, and for IL emitting are all exposed to developers via rich managed APIs.  As an example, in the following screenshot I’m taking advantage of the Roslyn APIs to parse some code and display the tree of syntax nodes.

The Visual Studio language services for C# and Visual Basic have been rewritten to use these new APIs.  And new tools have been introduced to take advantage of all of these services. For example, the new C# Interactive window enables scripting and exploration in C#:

Roslyn represents an exciting opportunity for developers to build richer tools, such as refactorings and deep visualizations, utilizing the same support that Visual Studio and its compilers would use for their work.  It should be noted, however, that this is an early look at this compilation infrastructure, as the Roslyn work is focused towards a post-Visual Studio 11 release. This CTP will help to illuminate the kinds of exciting end-to-end experiences that are possible with such technology, but at the same time this particular release only supports a subset of each language and is intended for exploration and to enable us to gather feedback from you on the direction.

For more information on Roslyn, to download the CTP, and to let us know what you think, visit https://www.msdn.com/roslyn.

Namaste!

Comments

  • Anonymous
    October 19, 2011
    there is nothing published yet!@!!

  • Anonymous
    October 20, 2011
    Hi liviu, What are you having trouble finding? The link http://www.msdn.com/roslyn should work and take you to the MSDN landing page for the Roslyn CTP where you can find download links, as well as documentation. -- Kevin Pilch-Bisson kevinpi@microsoft.com http://twitter.com/Pilchie

  • Anonymous
    October 21, 2011
    The F# interactive is nice, I'm glad you're incorporating the same into C#!

  • Anonymous
    October 22, 2011
    Are we going to see language providers for C++ and Python?

  • Anonymous
    October 22, 2011
    Hi Jonathan- For now, the Roslyn project covers only C# and Visual Basic.

  • Anonymous
    October 23, 2011
    RAD tools in VS lack luster at best and MSFT introduces even more low level tool to clunky up development and get in our way. Nice work!  

  • Anonymous
    October 24, 2011
    Just downloaded Roslyn. Very interesting feature, good to see this initiative, it unleashes new opportunities i.e. in building complex tools.

  • Anonymous
    October 25, 2011
    This is pretty cool. I think those tools are also valuable for educational purposes. regards, Itzik

  • Anonymous
    November 17, 2011
    Great article!  The link to download it is broken! Any suggestions? Thanks!

  • Anonymous
    November 17, 2011
    Hi William- I just tried the link, and it works for me.  Can you try going directly to msdn.microsoft.com/.../roslyn?  You can also go to the download page on the Download Center at http://www.microsoft.com/download/en/details.aspx?id=27746. Thanks.

  • Anonymous
    March 20, 2012
    what is the location for installing msdn library in the system

  • Anonymous
    March 25, 2012
    kiran, which documentation are you looking for?  The reference docs for Roslyn are not yet integrated into the online MSDN help, as Roslyn is still a technology preview.  Instead, the Roslyn CTP download available at http://msdn.com/roslyn includes multiple whitepapers and samples on how to use the system; such whitepapers are also available on the site itself.

  • Anonymous
    May 14, 2013
    Roslyn rocks. Definitely the most exciting new VS feature. All we need now is for other languages to be supported, like Typescript and Javascript. At the moment its still a pain to be able to generate Typescript or Javascript files representing C# classes as the compiler service sees them as being in error because they're not valid .cs files. And without the ability to be able to add a new project to an existing solution you really have to wrangle generated files in other languages to be able to integrate them into said solution. Otherwise, Roslyn opens up a whole new dimension of writing code to write code! :) Anders is truly the man! Great work guys!

  • Anonymous
    May 21, 2013
    Thanks for this great CTP. I noticed that when you install this CTP on updated visual studio (with update 2) "Code Map" feature and showing class members in solution explorer no longer works. thanks n.asaadi@rsa.co.ir

  • Anonymous
    May 23, 2013
    Hi Naser, Can you send me an email at kevinpi@microsoft.com?  I'd like to follow up on the issues you are seeing with Code Map and Solution Explorer. Thanks! -- Kevin

  • Anonymous
    October 04, 2014
    Hi Somasegar , Thanks for sharing information about Roslyn. Asmita