Live data from Hacker News

.NET 8 Standalone 50% Smaller On Linux

learn.microsoft.com

171–179 of 179 posts

Re: .NET 8 Standalone 50% Smaller On Linux

#171
post #72

2MB for a standalone “Hello World” binary in C# is a similar size to one in Go. Do both languages produce similar-sized binaries for larger projects as well? If so, would C# be a good choice for writing cross-platform command-line applications? It seems that C# can produce easily-distributable binaries, while also hitting a sweet-spot in language design - not super complex like C++ or Rust, and also not overly simpli…

Aside from syntax preferences, why and when would one choose Go over C#?

Because it was made to run on Linux from the start. I remember being excited to work with .net core on Linux, then discovering that most of the system libraries for network programming and related were either not implemented or badly working, but you would only find out if dug deep into low level stuff. After that, I swore of using it seeing how much the hype for cross platform didn't match reality. Hopefully they fixed it, but seeing as there are other choices of languages, it wasn't so bad.

Re: .NET 8 Standalone 50% Smaller On Linux

#172

Earlier quoted context omitted.

Jellyfin is great for movies & shows. As an anecdote, it's not so good for music if you're a collector. I personally use Navidrome for that[0]. Anyway, Sonarr[1] makes use of .NET, too. Very reliable software, in my experience. [0]: https://github.com/navidrome/navidrome [1]: https://github.com/Sonarr/Sonarr

I am a music collector and I don't see a problem with Jelly, apart from android app pausing after first song. It recognized my Musicbrainz filled library immediately without any problem, it was 0 effort to have it fully available on the web with multiple accounts.

IME Jellyfin struggles to deal with a few edge-cases, and the ecosystem for Subsonic is generally better: more applications, more servers, and therefore ultimately more choice. Though Navidrome may be the most popular, there are plenty of clients to choose from (Supersonic, Sublime-music, etc. etc.) where such an ecosystem doesn't really exist for Jellyfin.

Re: .NET 8 Standalone 50% Smaller On Linux

#173
post #33

Earlier quoted context omitted.

Calling ServiceStack OSS is disingenuous since it comes with quite a heavy price tag for commercial use.

Not back in the day. IIRC it was mostly FOSS and the author gradually shifted to a more commercial model when MS waltzed all over it with ASP.NET Web API. I’m quite impressed he made it through actually, and I can’t fault someone for going full commercial when a giant moloch whose ecosystem you’re supporting pulls the rug under you like that.

To be fair ASP.NET Web API was just the natural progression of ASP.NET MVC which is based on Monorail more than anything else. You're making it sound like the community was set on ServiceStack and then MS reeled them back in, but the truth is not many people were using ServiceStack back then, they were using ASP.NET MVC which had things like JsonResult and whatnot that would get you a long way.

That said, ServiceStack has transitioned to payware a long, long time ago and I'm pretty sure that is what's caused its demise, not ASP.NET Web API. As a single anecdotal data point, it's definitely the reason I'm not using it.

Re: .NET 8 Standalone 50% Smaller On Linux

#174

Earlier quoted context omitted.

From my experience golang uses less memory than a .net app. I haven’t done a recent comparison so if someone had tested this lately and has different results I’d love to see it.

When C# is AOT compiled, the memory footprint is roughly the same.

Do you have any reference for this?

I'm very curious to see how they managed to pull this off since from my knowledge of the development patterns, .net has historically been much more allocation-heavy (not that it isn't very efficient with allocated data).

Re: .NET 8 Standalone 50% Smaller On Linux

#175

Earlier quoted context omitted.

From my experience golang uses less memory than a .net app. I haven’t done a recent comparison so if someone had tested this lately and has different results I’d love to see it.

When C# is AOT compiled, the memory footprint is roughly the same.

Do you have any resources?

I was looking for similar benchmarks but couldn't find anything conclusive. I found the benchmark game [1] but only had .net 7 AoT (not .net 8) benchmarks and memory consumption seems too high.

I'd ditch golang on a pinch as soon as I can use a decent type system, and C# seems like a great alternative.

Crystal would be my ideal but its compiler is still too slow, sadly.

[1] https://programming-language-benchmarks.vercel.app/csharp-vs...

Re: .NET 8 Standalone 50% Smaller On Linux

#176
post #3

They also added a TimeProvider to help with testing time objects. Maybe one day we will also get an FileSystemProvider.. TimeProviderFake: https://learn.microsoft.com/en-us/dotnet/api/microsoft.exten... ReleaseNotes: https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotn...

> Maybe one day we will also get an FileSystemProvider. Until then you can use System.IO.Abstraction[1] if you aren't already :) [1] https://github.com/TestableIO/System.IO.Abstractions

This is what I use, but damn, does it make coding a bit annoying having to have an instance of the filesystem rather than using static classes like Path.

Re: .NET 8 Standalone 50% Smaller On Linux

#177
post #168

Everything dotnet is doing for cross-platform is great and better than alternatives --- except one HUGE issue: There is no official GUI on Linux. Linux's exclusion from MAUI (while 25% of world's developers' primary dev machine is a Linux system according to Stack overflow survery) creates a huge hurdle for those developing on Linux to build any cross platform GUI app with dotnet. If I , as a developer developing a w…

There's no "official GUI" (w/e that means) on Linux for anything though, so it makes sense. Avalonia exists, and from the looks of it is better than all the crap MS has put out over the years (even on Windows, don't get me started on WPF shutters ) so not using it because its not "official" is silly.

I never said I don't use or don't want to use Avalonia. The issue is not the quality of Avalonia/Uno. They are wonderful. The issue is not availability of third-party toolkits -- they are there. The core issue is being psychologically assured that the first party is interested in supporting my platform with its programming languages and libraries. If MS can support Mac, ios, and Android -- what exactly prevented it from supporting Linux ?? This conspicuous lack of support in the presence of support for other non-MS platforms is the most bothersome bit. And supporting Linux can't be too expensive either. If Avalonia and Uno being open source with no backing of a huge corporation can do it in their stride -- then Microsoft sure as hell can do it. Again , this time economically --- why exactly is MS supporting Mac, ios, and Android -- not Linux ???. I hope you see my point. The absence of MS support is not bothersome technologically. It is problematic attitude wise. If they are fine with not doing GUI on linux (while doing it on all the other platforms) --- what other features/enhancements they will be willing to hold back from Linux ??

Re: .NET 8 Standalone 50% Smaller On Linux

#178

Everything dotnet is doing for cross-platform is great and better than alternatives --- except one HUGE issue: There is no official GUI on Linux. Linux's exclusion from MAUI (while 25% of world's developers' primary dev machine is a Linux system according to Stack overflow survery) creates a huge hurdle for those developing on Linux to build any cross platform GUI app with dotnet. If I , as a developer developing a w…

One way to look at it is MAUI isn't more official than Avalonia or Uno, it just happens to be primarily driven by dedicated team from Microsoft. However, it does not mean that Avalonia or Uno are inferior due to just this fact. EF Core in that regard is very similar - you can easily use Dapper instead because it builds on the same primitives from System.Data. Neither MAUI nor other UI frameworks have access to intern…

The issue is not the quality of Avalonia/Uno. They are wonderful. The issue is not availability of third-party toolkits -- they are there. The core issue is being psychologically assured that the first party is interested in supporting my platform with its programming languages and libraries. If MS can support Mac, ios, and Android -- what exactly prevented it from supporting Linux ?? This conspicuous lack of support in the presence of support for other non-MS platforms is the most bothersome bit. And supporting Linux can't be too expensive either. If Avalonia and Uno being open source with no backing of a huge corporation can do it in their stride -- then Microsoft sure as hell can do it. Again , this time economically --- why exactly is MS supporting Mac, ios, and Android -- not Linux ???. I hope you see my point. The absence of MS support is not bothersome technologically. It is problematic attitude wise. If they are fine with not doing GUI on linux (while doing it on all the other platforms) --- what other features/enhancements they will be willing to hold back from Linux ?? reply

Re: .NET 8 Standalone 50% Smaller On Linux

#179

Earlier quoted context omitted.

One way to look at it is MAUI isn't more official than Avalonia or Uno, it just happens to be primarily driven by dedicated team from Microsoft. However, it does not mean that Avalonia or Uno are inferior due to just this fact. EF Core in that regard is very similar - you can easily use Dapper instead because it builds on the same primitives from System.Data. Neither MAUI nor other UI frameworks have access to intern…

The issue is not the quality of Avalonia/Uno. They are wonderful. The issue is not availability of third-party toolkits -- they are there. The core issue is being psychologically assured that the first party is interested in supporting my platform with its programming languages and libraries. If MS can support Mac, ios, and Android -- what exactly prevented it from supporting Linux ?? This conspicuous lack of support…

No, I do not see your point.

The reason why Avalonia and Uno have support for Linux but not MAUI is purely technical one - Avalonia and Uno draw their controls by themselves, like with Skia(sharp). MAUI tries to be a successor to Xamarin and uses native controls drawn by the host instead. Naturally, this has always been a problem on Linux and supporting it is non trivial (what do you choose? Attempt to make it work with Qt, GTK, something else entirely? what about X.Org vs Wayland?). Realistically, supporting mobile platforms first alongside Windows and macOS is much more important and is a far better investment of effort (how many users are there with desktops/laptops on Linux vs macOS/Windows) and there are only so many people working on this. It is perfectly fine for GUI frameworks to take different approaches and pursue different goals, where Linux systems are much better served by Avalonia.

Post reply on HN