As a C# dev I'm sometimes envious of the experience that Go devs have around building small selfcontained executables. Type a few lines into a .go file, `go build` the file and you have an executable that you can give to anyone and it runs (be it Ubuntu/Alpine/whatever). Yeah, with the default deployment model of C# it's nice that you don't have to worry about security vulnerabilities in your networking stack being unpatched until you rebuild your app (the networking stack is part of a runtime or other libraries that can be serviced independently from the app), but also not everything you build with C# is an internet-facing web server... and not everyone wants to carry a 20 MB runtime with a prerequisite list with their app.
.NET made huge progress since .NET Core (Linux support, single executable support, etc.) and I think it's getting where I would like to see it, but I decided to "help it" a little with a different take on the tooling. It's a prototype.
I took the experimental .NET AOT compiler (from Microsoft's NativeAOT project), mixed it with Roslyn (the official C# compiler) and built a standalone compiler/tool. I took out everything that people usually associate with C# (MSBuild, NuGet, the `dotnet` CLI) and left just the bare minimum: language and libraries.
The compiler can also crosscompile - just pass `--os` and `--arch` to specify the architecture.
It produces selfcontained native executables starting at ~730 kB for a Hello World referencing System.Console (uncompressed).
The compiler is self-hosted, so hopefully that's a good enough proof that it can already be used to build things.
The compiler comes in a ZIP file that you just extract and put on your PATH. It doesn't depend on anything else (no SDKs, no sysroot, no other tools).
You can target Linux already but there's no Linux version of the compiler itself because of some integration problems I still need to sort our (see Issues in the repo).
Disclaimer: I work at Microsoft, but this project is my freetime activity I whipped out without consulting anyone at work.
As a C# dev I'm sometimes envious of the experience that Go devs have around building small selfcontained executables. Type a few lines into a .go file, `go build` the file and you have an executable that you can give to anyone and it runs (be it Ubuntu/Alpine/whatever). Yeah, with the default deployment model of C# it's nice that you don't have to worry about security vulnerabilities in your networking stack being unpatched until you rebuild your app (the networking stack is part of a runtime or other libraries that can be serviced independently from the app), but also not everything you build with C# is an internet-facing web server... and not everyone wants to carry a 20 MB runtime with a prerequisite list with their app.
.NET made huge progress since .NET Core (Linux support, single executable support, etc.) and I think it's getting where I would like to see it, but I decided to "help it" a little with a different take on the tooling. It's a prototype.
I took the experimental .NET AOT compiler (from Microsoft's NativeAOT project), mixed it with Roslyn (the official C# compiler) and built a standalone compiler/tool. I took out everything that people usually associate with C# (MSBuild, NuGet, the `dotnet` CLI) and left just the bare minimum: language and libraries.
The compiler can also crosscompile - just pass `--os` and `--arch` to specify the architecture.It produces selfcontained native executables starting at ~730 kB for a Hello World referencing System.Console (uncompressed).
The compiler is self-hosted, so hopefully that's a good enough proof that it can already be used to build things.
The compiler comes in a ZIP file that you just extract and put on your PATH. It doesn't depend on anything else (no SDKs, no sysroot, no other tools).
You can target Linux already but there's no Linux version of the compiler itself because of some integration problems I still need to sort our (see Issues in the repo).
Disclaimer: I work at Microsoft, but this project is my freetime activity I whipped out without consulting anyone at work.