Currently I am developing a programming language and a compiler. I use antlr as a parser generator and I am implementing everything in C# targeting .Net Core 3.1
At the moment I am compiling my language into x86 GNU Assembler, but I have been thinking about compiling it into IL-Code as a lot of features like OO are deeply integrated into IL.
I have already found out, that there is the possibility to generate IL-Code on runtime with the System.Reflection.Emit
namespace, but in .Net Core it is currently not possible to set an entry point for the DLL or to save it persistently. I did also already dig a bit deeper into the code generation of the .Net Core compiler and read about Roslyn
, but it does only support generating IL-Code for C#-Code and I also don't want to dig deeper one more layer.
My Question is:
Does somebody know how to generate IL-Code and persistently save it when targeting .Net Core?