News for hackers. Stuff that matters.
Re:C# 9 top-level programs and target-typed expressions by smcl on Tuesday March 30, 2021 @06:38PM (#26641432)
Yes that is possible, you can produce an .exe which contains your application's assemblies but relies on the appropriate .NET runtime being present on the user's computer. You can also build a .exe which has the .NET runtime bundled, but it can be quite big. I made a simple program that wrote "Hello World" to the console [1] and it was between 46-78MB: https://blog.mclemon.org/no-this-is-what-peak-hello-world-lo...
Re:C# 9 top-level programs and target-typed expressions by pjc50 on Tuesday March 30, 2021 @06:46PM (#26641483)
Yeah, it's not really a "real" native binary.

You can get it down to 8kb by jettisoning all comforts: https://medium.com/@MStrehovsky/building-a-self-contained-ga... but that's not exactly practical.

Re:C# 9 top-level programs and target-typed expressions by smcl on Wednesday March 31, 2021 @04:07AM (#26644650)
Wow! Yeah indeed there's a few impractical steps required to go all the way to 8kb, but trimming down to a couple of MB is definitely a huge improvement. I somehow never looked into CoreRT before, I'm gonna need to do so. Thanks for sharing this!