What's the difference between RyuJIT and Roslyn?

11.4k Views Asked by At

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?

3

There are 3 best solutions below

0
On

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.

0
On

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.

1
On

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.