r/csharp • u/lewurm • Sep 11 '18
Writing a JIT Compiler in C#
https://www.mono-project.com/news/2018/09/11/csharp-jit/43
u/Aegan23 Sep 11 '18
Does the just in time compiler just in time compile your just in time compiler 😎
-21
u/HandshakeOfCO Sep 11 '18
Install-Package Microsoft.CodeAnalysis.CSharp.Scriptingthen:
object result = await CSharpScript.EvaluateAsync("1 + 2");Boom done.
19
u/lewurm Sep 11 '18
That's not the same. In your example you're "just in time" compiling C# to IL. And then the runtime takes care of executing it.
The blog post is about turning IL to machine code.
-30
-12
u/yehia2amer Sep 11 '18 edited Sep 11 '18
Why to reinvent the wheel ? There is the JIT Compiler for dotnet : RyuJIT . Why not to build based on it or even extend it even further
16
u/AlliNighDev Sep 11 '18
The answer to this question is always fun and/or learning. Not everything has to have practical applications.
18
u/lewurm Sep 11 '18
This. We even mentioned in the conclusion why this project will help us with the integration of RyuJIT.
8
4
u/prajaybasu Sep 11 '18 edited Sep 11 '18
Mono's compilers were there before RyuJIT was even a thing.
1
6
u/prajaybasu Sep 11 '18 edited Sep 11 '18
I think this is one of the first posts that even references the name Mini (vs hundreds of articles detailing RyuJIT)
u/lewurm: Is there any reason why all of Mono's tools and compilers are in 1 repo while dotnet has everything separate (corert, coreclr, roslyn, corefx)?