Roslyn (compiler)

.NET Compiler Platform (Roslyn)

Original author(s)| Microsoft
Developer(s)| .NET Foundation and the open source community
Stable release|

.NET 7.0.0 / November 8, 2022; 3 years ago (2022-11-08)[1]

Repository| github.com/dotnet/roslyn
Written in| C#, Visual Basic
Operating system| Windows, Linux and macOS
Platform| IA-32, x86-64
Type| Compiler
License| MIT License
Website| learn.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/

.NET Compiler Platform, also known by its codename Roslyn,[2] is a set of open-source compilers and code analysis APIs for C# and Visual Basic (VB.NET) languages from Microsoft.[3]

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.[4]

## Contents

* 1 Features
* 2 History
* 3 Architecture
* 4 See also
* 5 References
* 6 Further reading
* 7 External links

## Features

Features of Roslyn include:

* Compilers for the C# and Visual Basic languages exposed as services via APIs.
* APIs for code analysis and refactoring.[citation needed]

## History

The code name "Roslyn" was first written by Eric Lippert (a former Microsoft engineer[5]) in a post[6] that he published in 2010 to hire developers for a new project. He first said that the origin of the name was because of Roslyn, Washington, but later in the post he speaks ironically about the "northern exposure" of its office; the city of Roslyn was one of the places where the television series Northern Exposure was filmed.[7]

Microsoft made a community technology preview (CTP) available for public download in October 2011. It installed as an extension to Visual Studio 2010 SP1.[8]

The CTP was updated in September 2012[9] to include many updates to the Roslyn APIs introduced in the June 2012 and October 2011 CTPs, including breaking changes.[10] While the June 2012 CTP API is complete for the compilers, not all features were implemented for the C# and VB.NET languages.[11]

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. As of April 3, 2014[update], Roslyn is under the Apache License 2.0.[3] The project was effectively transferred under the stewardship of the newly founded .NET Foundation.[12] At the same conference, Xamarin announced that they are working on integrating the new compilers and tools in Xamarin Studio.[13]

The compilers were 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 14). The APIs are also available through the NuGet package manager.[citation needed]

As of 2013[update], Roslyn supports VB and C#, and the compilers are written in their respective languages.[14] Roslyn's first release to manufacturing (RTM) was with Visual Studio 2015.[15]

In January 2015, Microsoft moved the Roslyn source code from CodePlex to GitHub.[16]

## Architecture

Traditionally .NET compilers have been a black box for application developers.[17] With increasing complexity and demands for source code analysis in modern integrated development environments, however, compilers need to expose application programming interfaces (APIs) that will help developers to directly perform phases of compilation such as lexical and syntactic structure analysis of source code. Roslyn was designed with that intent from the beginning. This reduces the barrier in developing tools specifically designed for source code analysis. APIs of Roslyn are of three types: feature APIs, work-space APIs and compiler APIs. Feature APIs allow source code tool developers to do code refactoring and fixes. Work-space APIs allow plugin developers to perform actions specifically required in integrated development environments (IDEs) like Visual Studio such as finding references of a variable or code formatting. Compiler APIs allow even more sophisticated analysis of source code, by exposing direct calls to perform syntax tree and binding flow analysis.[18] Using an open-source implementation of Common Language Infrastructure (CLI) such as .NET Core, Roslyn will be able to compile in a platform-agnostic manner capable of running CLI code in Linux, OS X, and Windows.[citation needed]

## See also

* List of compilers
* Microsoft Phoenix

## References

1. ↑ "Release .NET 7.0.0". GitHub. 14 December 2021. https://github.com/dotnet/roslyn/releases/tag/v4.0.1.
2. ↑ "C# and Visual Basic - Use Roslyn to Write a Live Code Analyzer for Your API". https://msdn.microsoft.com/en-us/magazine/dn879356.aspx.
3. ↑ 3.0 3.1 .NET Compiler Platform ("Roslyn") on GitHub
4. ↑ Neil McAllister, Microsoft's Roslyn: Reinventing the compiler as we know it, DEVELOPER_WORLD, 2011-10-20
5. ↑ "Fabulous adventures in coding". Eric Lippert. November 29, 2012. https://ericlippert.com/about-eric-lippert/.
6. ↑ "Hiring for Roslyn". Eric Lippert. 2010-12-16. https://blogs.msdn.microsoft.com/ericlippert/2010/12/16/hiring-for-roslyn/.
7. ↑ Muir, Pat (5 Oct 2014). "Roslyn hopes new TV show brings 15 more minutes of fame". Yakima Herald. http://www.yakimaherald.com/photosandvideos/localphotos/2542464-8/roslyn-hopes-new-tv-show-brings-15-more.
8. ↑ Microsoft "Roslyn" CTP , Microsoft Download Center
9. ↑ Microsoft "Roslyn" CTP, Microsoft Download Center
10. ↑ What's New in the Microsoft "Roslyn" September 2012 CTP, Visual Studio vNext Forums
11. ↑ Known Limitations and Unimplemented Language Features, Visual Studio vNext Forums
12. ↑ .NET Foundation – Open Source Foundation for the .NET Community
13. ↑ "Highlights from Build 2014's Second Keynote" (in en). https://www.infoq.com/news/2014/04/Build-2014-Keynote-2/.
14. ↑ Microsoft Roslyn vs. CodeDom
15. ↑ Visual Studio 2015 RTM, 2015-07-20
16. ↑ We're moving to GitHub! , MSDN VBTeam Blog, 2015-01-10
17. ↑ "Whitepaper: Roslyn Project Overview". https://www.microsoft.com/en-us/download/details.aspx?id=27744.
18. ↑ Overview of Roslyn from GitHub documentation

## Further reading

* Roslyn Cookbook: Compiler as a Service, Code Analysis, Code Quality and more. Packt Publishing. 2017. ISBN 978-1787286832.
* Code Generation with Roslyn. Apress. 2017. ISBN 978-1484222102.
* Source Code Analytics With Roslyn and JavaScript Data Visualization. Apress. 2017. ISBN 978-1484219249.

## External links

* Introducing the Microsoft “Roslyn” CTP on the C# Frequently Asked Questions MSDN blog
* Throwing the Big Switch on Roslyn on the C# Frequently Asked Questions MSDN blog

* v
* t
* e

Microsoft free and open-source software (FOSS)

Overview|

* Microsoft and open source
* Shared Source Initiative

Software|

| Applications|

* Atom
* Conference XP
* File Manager
* Open Live Writer
* PowerToys for Windows 10
* Windows Calculator
* Windows Console
* Windows Terminal
* WorldWide Telescope
* XML Notepad

|

Video games|

* Allegiance

Programming languages|

* Bosque
* C#
* Dafny
* F#
* F*
* IronPython
* IronRuby
* P
* PowerShell
* Q#
* R Open
* Small Basic
* TypeScript
* Visual Basic .NET

Frameworks and
development tools|

* .NET Bio
* .NET Core
* .NET Framework
* .NET Micro Framework
* AirSim
* ASP.NET
* ASP.NET AJAX
* ASP.NET Core
* ASP.NET MVC
* ASP.NET Razor
* ASP.NET Web Forms
* Blazor
* C++/WinRT
* ChakraCore
* CLR Profiler
* DiskSpd
* Dryad
* Electron
* Entity Framework
* Managed Extensibility Framework
* Microsoft Automatic Graph Layout
* Microsoft Cognitive Toolkit
* Microsoft Detours
* ML.NET
* Mono
* MonoDevelop
* MSBuild
* NuGet
* Open Management Infrastructure
* Orleans
* ProcDump
* R Tools for Visual Studio
* Roslyn
* Sandcastle
* SignalR
* StyleCop
* SVNBridge
* T2 Temporal Prover
* Text Template Transformation Toolkit
* vcpkg
* Virtual File System for Git
* Visual Studio Code
* Windows Communication Foundation
* Windows Driver Frameworks
* Windows Forms
* Windows Presentation Foundation
* Windows Template Library
* WinJS
* WiX
* Z3 Theorem Prover

Operating systems|

* MS-DOS
* Barrelfish

Licenses|

* Microsoft Public License
* Microsoft Reciprocal License

Related|

* .NET Foundation
* F Sharp Software Foundation
* Microsoft Open Specification Promise
* Outercurve Foundation

Category

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Roslyn (compiler). Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Software:Roslyn_(compiler)&oldid=754411"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template