Live data from Hacker News

.NET 8 Standalone 50% Smaller On Linux

learn.microsoft.com

121–130 of 179 posts

Re: .NET 8 Standalone 50% Smaller On Linux

#121

What the .NET team does on the technical side is almost universally wonderful. They've (ironically?) been a bit more successful than the Java folks at establishing multiple serious languages of different kinds running on and interoperating via the same runtime. But it's still a Microsoft project and their sword keeps looming over its head. There have been some heavy-handed anti-developer choices in the past and one c…

Have you looked at Google recently or Oracle for the entirety of its history?

Re: .NET 8 Standalone 50% Smaller On Linux

#123

Is static linking supported now? It's the one blocker for me to use C# in weird places. I'm good at hacking the underlying environment to make it work, but dynamic loading is not on the table.

It is - https://learn.microsoft.com/en-us/dotnet/core/deploying/nati.... You can even do the reverse and statically link NativeAOT-built libraries into existing projects written in "unmanaged" languages (though that naturally limits you to C interop).

Re: .NET 8 Standalone 50% Smaller On Linux

#124

Who is using .NET on Linux? I'm interested to hear success stories. Sounds like a a great way to build and deploy applications.

We are - we are in the process of transitioning our ASP.NET based backend from Windows to Linux. Linux machines are cheaper and easier to administer than Windows based ones.

Same here. We are also getting some performance gains on transaction processing and system.io stuff (10% or so) compared to windows.

Additionally, some of clients are linux and we have to ensure that our programs work flawlessly on it.

Re: .NET 8 Standalone 50% Smaller On Linux

#125
post #112

Earlier quoted context omitted.

I am. I've been developing with .NET since the start and my current workflow is really the smoothest and most productive (and most enjoyable!) I've ever had: I develop solely on Mac (JetBrains Rider), compiling/debugging Mac binaries locally - no containers - unless I need any external dependencies like eg. Postgres. On M1 MacBook Pro the experience is blazing fast - and Rider can be pretty heavy but Apple Silicon ea…

Same workflow here on Mac. Working with a few windows devs and don’t have any issues. We deploy into Microsoft .NET containers currently. Side note, great website! It’s so rare to see such an aesthetically pleasing site on here! Do you happen to have any open source repos where you implement a lot of what you talk about? I’m interested to look under the hood at your code and your versioning system (I’m sure more, too…

That's very kind of you to say, I appreciate that. It's relatively new and still quite a bit unfinished (in my eyes...)

Having spent the last decade or so buried deep in quite a big project, I have shamefully very little to show in terms of open source - but that will likely change quite a bit over the coming year.

I do plan to talk more on my blog about my approach to versioning and various dev/CI tooling.

Always happy to chat to like-minded people so feel free to ping me a message via my contact form if you'd like to talk more tech :) Happy to share a bit more about versioning - the approach mentioned in my article still works really well for me.

Re: .NET 8 Standalone 50% Smaller On Linux

#126
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#?

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.

Re: .NET 8 Standalone 50% Smaller On Linux

#127
post #115

Earlier quoted context omitted.

You do have some tooling support for ordering files in VS and VSCode using Ionide. It is also not always the case that there is a right way to order the files and checking all permutations would get expensive fast. Basically, in F# that is part of the design process and helps you a lot later since you can just read the code in a linear way the same way the compiler does and not miss anything. You do get the same info…

I’m not impressed by this design choice. When order of declaration matters, it ceases to be declarative. “Let there be a function” is instead “make me a function”. It’s entirely unnecessary, and even JavaScript can let you run a function that gets declared later. The advantage when order does not matter inside the module is that you can list big things at the top of the file and the smaller things it’s made of below,…

[deleted]

Re: .NET 8 Standalone 50% Smaller On Linux

#128
post #8
post #5

This is for native AOT binaries, not for the typical case. Though this release and the previous ones did contain improvements for trimming binaries, which is what you need to use to make non-AOT binaries smaller.

Curious - why isn't it the typical case? .NET runtimes on Linux itself are rare enough, I figured AOT on Linux would be about the only use case, especially in containerized environments.

dotnet is available in the big distros package managers.

Re: .NET 8 Standalone 50% Smaller On Linux

#129

What the .NET team does on the technical side is almost universally wonderful. They've (ironically?) been a bit more successful than the Java folks at establishing multiple serious languages of different kinds running on and interoperating via the same runtime. But it's still a Microsoft project and their sword keeps looming over its head. There have been some heavy-handed anti-developer choices in the past and one c…

> They've (ironically?) been a bit more successful than the Java folks at establishing multiple serious languages of different kinds running on and interoperating via the same runtime.

Can you explain more? I'm less familiar with the .net side of things.

Re: .NET 8 Standalone 50% Smaller On Linux

#130

Who is using .NET on Linux? I'm interested to hear success stories. Sounds like a a great way to build and deploy applications.

Our company's app is written in .NET 7 (soon to upgrade to .NET 8) and deployed via Linux containers into Kubernetes.

It is a delightful ecosystem to work with. Productivity is huge, great tooling and IDE support even in non-MS ways. I joined this company 3 months ago and what I've been able to get done on this platform is honestly exciting. And I haven't had to sacrifice modern development principles.

Post reply on HN