Re:.NET 6 Released
by mrweasel on Monday November 08, 2021 @03:32PM
(#29153854)
Wait, wait… .Net can build “static linked” executables that doesn’t require that I install .Net to run? I had no idea, I guess it’s time to revisit .Net
[ Parent
| on HN ]
That's exactly what it is. You can even cross-compile for all supported platforms.
$ dotnet new console -n HelloWorld
$ dotnet publish --project HelloWorld -r osx-arm64 --self-contained -o out -p:PublishTrimmed=true
$ du -sh out
10MI haven't used .net. But how memory management happens when you are running a binary executable? Does it have a builtin CLR (Common Language Runtime[1])? Because CLR provides the tools for managing memory & security?
Yes, it embeds the CLR in to the application see the PR at https://github.com/dotnet/runtime/issues/43072
Wow... I didn't know. Since when can it do this?
I've been using this for at least a year or two. With their stripping, my binaries (which use very little other than system.* and math.*) are 12M in size on each OS. I tested with today's release of version six, the binaries are about 1M smaller each.
I believe it was introduced around .NET Core 5? or 3? so at least 1 year ago
Re:.NET 6 Released
by metaltyphoon on Monday November 08, 2021 @08:00PM
(#29156408)
Since .net core 3.0
After almost 18 years, Joel finally got his wish:
https://www.joelonsoftware.com/2004/01/28/please-sir-may-i-h...
This, combined with linker stripping below even assembly level for smaller static binaries.
.NET 7 will work on NativeAOT for instantaneous startup of especially smaller apps, but I think they’ve already optimized JIT warmups or something — I was pleasantly surprised when I just wrote a .NET 6 console app that read JSON from a server.
Re:.NET 6 Released
by JohnTHaller on Tuesday November 09, 2021 @02:57PM
(#29166654)
If it's like v5, you can. They're big (since they include .NET, though it looks like v6 will strip out more than v5). And they won't run on Windows 7 without an administrator installing a system component first.