I'm able to develop .NET Core based C# apps through VS for Mac, and now I've created a "compiler" which generates C# for a language I created. I would like to at least run the output (a single file called Program.cs) and hopefully compile it to an executable on macOS.
On Windows, this can be done with:
csc /optimize /t:exe /out:Program.exe Program.cs
Oddly enough, this exact command works identically on macOS too, and generates a Windows executable. What I would like is this equivalent for a mac executable. However, the csc documentation states that the only compiler targets are 'library', 'module', and Windows apps.
To clarify, I don't want to run the code at runtime, but to build an executable from code that was generated (as a string) at runtime.
csc
command – Mateycsc
calls the Roslyn API – Matey