28

I understand that RyuJIT is a quicker compiler than JIT. But is it the new standard for the .NET 4.6 or is that Roslyn?

Or is it that Roslyn is used when you need to expose APIs during the compilation process?

I'm confused between their purposes and what frameworks they'll be found in. Can someone explain the difference & when you want one over the other, please?

myfunnyfella
  • 1,357
  • 3
  • 18
  • 25
  • 3
    The RyuJIT project created a replacement for the x64 jitter, the original one that shipped in .NET 2.0 had too many bugs that could not get fixed. No correlation at all with the Roslyn project, that they shipped at the same time was an accident. – Hans Passant Jul 13 '16 at 12:20
  • @eliarbel thanks. So does it mean Roslyn can be a replacement for csc.exe - the Csharp compiler? – myfunnyfella Jul 13 '16 at 15:49

3 Answers3

40

Roslyn is the compiler that compiles your code (C# or VB) to IL.

RyuJIT is a Just In Time compiler that compiles your IL to native code.

Both of them are now open source.

Roslyn

RyuJIT, Tutorial

Roslyn API is what you need if you want to play with syntax tree, compilation, and semantic model.

RyuJIT doesn't have a public API.

Eli Arbel
  • 22,391
  • 3
  • 45
  • 71
Dudi Keleti
  • 2,946
  • 18
  • 33
22

Roslyn is a compiler that takes your source code and generates IL bytecode. RyuJIT takes said bytecode, at runtime, and generates native code. You can embed Roslyn into an app to compile source code on the fly, but RyuJIT is strictly for the runtime and cannot be accessed as far as I know.

Joel Lucsy
  • 8,520
  • 1
  • 29
  • 35
4

You are trying to compare apples to oranges...

RyuJIT (the default x64 JIT for .NET 4.6) compiles MSIL to native processor code, during runtime. Roslyn creates MSIL from your (C#?) code.

Joezer
  • 625
  • 1
  • 9
  • 20
  • 9
    No he isn't. He was asking specifically if they are incompatible apples and oranges or what are the differences in form/scope. – Jon Davis Jun 25 '18 at 19:52