Live data from Hacker News

.NET 8 Standalone 50% Smaller On Linux

learn.microsoft.com

21–30 of 179 posts

Re: .NET 8 Standalone 50% Smaller On Linux

#21
post #9
post #8

Earlier quoted context omitted.

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.

.NET uses a lot of reflection, and you need to replace that with other mechanisms for AOT. And for modern .NET (previously named .NET Core, the version that also runs on Linux) you can package the runtime with the binary. You can even create single-file executables there, though those are still not AOT. The main advantage of AOT is startup time, and that didn't use to matter much for the kind of applications .NET was…

I wouldn't be surprised if reflection usage starts diminishing, with source generators solving a number of use-cases while maintaining AOT.

Re: .NET 8 Standalone 50% Smaller On Linux

#22

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

I once was CTO of a now defunct startup and we ran a C# backend against a postgres db inside Docker containers on Linux. This was before MS was on board with Linux and all, but Mono was already super good tech. It wasn’t as fast as real .NET but it was still way faster than eg Python or Ruby, the popular backend languages of the day. There was even a half decent cross platform IDE (MonoDevelop), most of the dev team…

Re: 4th paragraph

Nowadays Windows only provides a nice SDK for C#. If you want to create apps in any other language you will need to use the Win32 ABI or some wrapper.

Re: .NET 8 Standalone 50% Smaller On Linux

#23
post #9

Earlier quoted context omitted.

.NET uses a lot of reflection, and you need to replace that with other mechanisms for AOT. And for modern .NET (previously named .NET Core, the version that also runs on Linux) you can package the runtime with the binary. You can even create single-file executables there, though those are still not AOT. The main advantage of AOT is startup time, and that didn't use to matter much for the kind of applications .NET was…

I wouldn't be surprised if reflection usage starts diminishing, with source generators solving a number of use-cases while maintaining AOT.

I think that is likely, though the current source generators are often a bit cumbersome to use. Though that is why they're adding interceptors, which while it is a bit of a controversial feature is kinda necessary to implement source generators without having an annoying API.

Re: .NET 8 Standalone 50% Smaller On Linux

#24
post #18
post #14

Earlier quoted context omitted.

We do, in the few things we haven’t yet migrated away from C#. I’m curious as to why you wouldn’t, it’s much cheaper than deploying on windows since you’ll likely need a license for that. We use it for a range of things. Mostly related to the legacy software of when our developers were mostly C# developers. Which isn’t how things are now, as C# has often stood in the way of our ability to deliver business value at a…

What language and frameworks has your business shifted into? How has that better fit the goals of speed of development and maintainability?

We’re switching into Powershell for operations. With azure automation.

We’re switching to Go for concurrency. C and C++ for computation (though to be fair, we were already doing this with C# and the integration between them has always been great).

Our generalist language has become TypeScript however. Not because it’s great technically, but because it lets us share resources better which in term has made us much more productive in meeting our business needs.

I don’t think C# is bad, I also think it’s much better today than it used to be. If your use of it remains within what works well I think it’ll be hard to find a language with better tooling, but if your needs go beyond that you’re going to have to fight it a lot.

Re: .NET 8 Standalone 50% Smaller On Linux

#25
post #22

Earlier quoted context omitted.

I once was CTO of a now defunct startup and we ran a C# backend against a postgres db inside Docker containers on Linux. This was before MS was on board with Linux and all, but Mono was already super good tech. It wasn’t as fast as real .NET but it was still way faster than eg Python or Ruby, the popular backend languages of the day. There was even a half decent cross platform IDE (MonoDevelop), most of the dev team…

Re: 4th paragraph Nowadays Windows only provides a nice SDK for C#. If you want to create apps in any other language you will need to use the Win32 ABI or some wrapper.

[deleted]

Re: .NET 8 Standalone 50% Smaller On Linux

#26

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

I have good and bad experience as well.

I do have a prototype project, and while it allowed to get going quickly, I found the remote debugging story useless, as Visual Studio 2022 SSH support is a steaming pile of garbage. (Doesn't use the windows systemwise ssh install, but some crappy library that only supports password auth, or some wonkny certificate format, and outdated ciphers, which is understandably disabled, wasted an hour and insecured the target machine, and gave up finally).

I used SQLite, and the System.Data.SQLite, because reasons (legacy). It is a bug ridden piece of work (on linux), with no sane way to contribute. Also it is useless on M1 Mac, as the author doesn't give a shit about compiling it for arm (or setting up a CI pipeline on github or gitlab for example, where it is supported).

Had plenty of problems with single file app bundle deployment, as much as it eased deployment initially, lots of libraries broke on it.

It has been working okay for us (in other former projects) generally well, but personally I am missing some things from the JVM, where VM tuning and monitoring and remote debugging are all a smoother ride in my experience.

Oh, and async broke the C# language (or rather the standard library) and killed the CLR interop with other languages, it was a big mistake to release it with these defaults. I really like F#, but async everything made it uselessly difficult in my opinion. But it has nothing to with .Net on Linux. It works, and is way better than the nodejs world, but I think more ideas should be copied from the JVM world to ease the Ops side, or they should be more clearly communicated.

Re: .NET 8 Standalone 50% Smaller On Linux

#27

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

At my company, every api server and azure function is executed in k8s as linux container. The license costs and performance footprint are a huge factor to not run on windows. And docker-images for the CI production. Linux is just so much better IMHO. I would switch to linux if visual studio (not vscode) would run there natively.

Re: .NET 8 Standalone 50% Smaller On Linux

#28
post #14

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 do, in the few things we haven’t yet migrated away from C#. I’m curious as to why you wouldn’t, it’s much cheaper than deploying on windows since you’ll likely need a license for that. We use it for a range of things. Mostly related to the legacy software of when our developers were mostly C# developers. Which isn’t how things are now, as C# has often stood in the way of our ability to deliver business value at a…

I agree that many of MS’s “open source” libraries (eg EF, OData) are half-assed, badly run projects.

I’m also still mad at them for competing against amazing stuff like ServiceStack (a real OSS project from the community, and the best way to run REST APIs I’ve ever seen) with “official” but worse stuff like ASP.NET Web API. They do this a lot, some OSS gets popular but instead of embracing it, they make a half-assed ripoff, proudly proclaim it “official” on conferences and all the C# devs jump off the cliff like lemmings, and the original OSS project dies/stagnates. MS might have officially embraced Open Source but they’re absolutely awful at fostering an OSS community.

But .NET itself is amazing! There’s this weird misconception in Microsoft land that if you choose .NET you must also use all MS’s half-assed libraries. Just use Postgres! Use a lean ORM like Dapper, use Redis, use whatever you want from the wider OSS ecosystem. There’s nothing about C# that forces you onto Entity Framework. Get out of that red polo shirt and look around, there’s a lot of cool stuff out there.

Re: .NET 8 Standalone 50% Smaller On Linux

#29

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

Most .NET backend services and web apps are now deployed on Linux (containers). The default .NET PaaS experience on Azure (App Service) also defaults to Linux.

Re: .NET 8 Standalone 50% Smaller On Linux

#30

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

Microsoft shops cutting down on license costs for serverless deployments on Azure.

For those cases we do the same approach we have been doing with Java for decades, developing on Windows, deploying on Linux based instances.

Other than that, still too many projects depend on .NET Framework.

I still have too much of .NET version of Python 2/3 transition.

Post reply on HN