35

Recently I started reading about .NET reorganization details (mostly through .NET Core github pages). It seams that they created sibling projects to support more platforms. While reading I have the impression that CoreCLR and CoreRT is a new OpenSource version of propriety Roslyn compiler. CoreRT provides native (AOT) compilation. And LLILC is an alternative implementation directing LLVM framework.

Can anyone confirm and describe the differences and goals of this projects from the user perspective? Why someone would use Roslyn in the future instead of CoreCLR?

Svek
  • 10,726
  • 4
  • 32
  • 63
Robert Zaremba
  • 6,780
  • 6
  • 40
  • 71
  • 6
    Roslyn is entirely open-source, there is nothing proprietary about it as far as I know. – Jeroen Vannevel Jan 07 '16 at 21:02
  • 6
    CoreRT is a runtime. Roslyn is the C# and VB compiler, compiling source code to IL. They're entirely different things. – Jon Skeet Jan 07 '16 at 21:12
  • 3
    @JonSkeet - you should post your comment as an answer. – Robert Zaremba Jan 24 '16 at 19:38
  • 1
    I don't think so. It would be a very brief answer, without much in the way of detail... a simple search would discover that much and more, to be honest. – Jon Skeet Jan 24 '16 at 19:39
  • My comments here: http://stackoverflow.com/questions/22867991/what-is-new-net-native/22868113 – nawfal Jun 30 '16 at 22:00
  • @ Jeroen Vannevel There is no relationship between a product being open-source and proprietary. Roslyn is both open-source and proprietary. This is one of the biggest myths of open source software. – Gavin Williams Feb 17 '17 at 02:09

1 Answers1

61

Roslyn is a compiler platform that enables you to build static and dynamic analysis tools and custom language extensions and transformations for the C# and VB programming languages.It also enables you to embed these languages within other languages or applications. Roslyn includes the C# and VB compilers and other tools. These compilers emit Common Intermediate Language (CIL) code.

To run this code, CIL has to be compiled into binary code that the target computer architecture can execute. .NET currently provides three ways to do this:

  1. Compile the CIL code into binary code using a JIT compiler while the app is running. This model is implemented by CoreCLR. CoreCLR started as a copy of CLR. It has been modified to support different OSes. They're maintained separately and in parallel.
  2. Compile the CIL code into binary code and integrate any required .NET framework components to produce a single-file self-contained executable whose performance is closer to code written native languages. This technology is called .NET Native. CoreRT is an open-source implementation of this technology. The main difference between .NET Native and CoreRT is that the AOT compiler that the former uses is the UTC compiler (the MSVC compiler backend) while the latter currently uses RyuJIT. UTC is much more aggressive in optimizing the code than RyuJIT. Also in CoreRT, some components of the runtime have been cleanly reimplemented in C#. CoreCLR still uses the C++ implementation.
  3. NGEN which is similar to .NET Native except that the produced executables are not self-contained and requires an externally installed runtime.

LLILC is a CIL compiler based on the portable LLVM compiler framework. It can be used to build JIT (current) and AOT (future) compilers. The advantage of this compiler is that it leverages the Clang C++ compiler optimizations and brings the LLVM extensibility model (analysis and optimization passes) to .NET.

CoreRT and LLILC are new projects and still in early development stage and require a lot more work to support production applications. So if you are a user and not a contributor, CoreCLR and Roslyn are for you. Again, CoreCLR is the runtime while Roslyn is the C# and VB compilers.

richzilla
  • 34,719
  • 13
  • 51
  • 80
Hadi Brais
  • 18,864
  • 3
  • 43
  • 78
  • Does anyone know if LLILC is still under active development or if there is a replacement? Their GitHub page shows no activity for the last two years. – Anthony Gatlin Mar 08 '18 at 04:00
  • 3
    @AnthonyGatlin See [this](https://github.com/dotnet/llilc/issues/1075#issuecomment-345278134). It appears that LLILC is neither dead nor alive. – Hadi Brais Mar 08 '18 at 04:10
  • 2
    @AnthonyGatlin What makes you think they are pushing people away from .net core? They are pouring plenty of effort into .net core. .net core 3.0 coming in 2019 and many more releases planned along with C# 8.0 – IEnjoyEatingVegetables Nov 14 '18 at 18:54
  • 3
    @JohnOsborne, I have changed my opinion since I left that comment eight months ago. I use .NET Core everyday and agree they are pouring plenty of resources into the project. My opinion was incorrect. – Anthony Gatlin Nov 14 '18 at 21:17