Most active commenters

    ←back to thread

    .NET 10

    (devblogs.microsoft.com)
    489 points runesoerensen | 12 comments | | HN request time: 0.015s | source | bottom
    Show context
    jitbit ◴[] No.45888669[source]
    For us, every .NET upgrade since .NET 5 has gone surprisingly smoothly and reduced CPU/RAM usage by 10–15%.

    We were even able to downgrade our cloud servers to smaller instances, literally.

    I wish .NET was more popular among startups, if only C# could get rid of the "enterpisey" stigma.

    replies(26): >>45888799 #>>45888804 #>>45889332 #>>45891939 #>>45896032 #>>45898279 #>>45898305 #>>45898358 #>>45898503 #>>45898877 #>>45899062 #>>45899235 #>>45899246 #>>45899326 #>>45899445 #>>45899481 #>>45899858 #>>45900544 #>>45900791 #>>45900829 #>>45903218 #>>45904345 #>>45904435 #>>45905041 #>>45906073 #>>45907122 #
    parliament32 ◴[] No.45899481[source]
    I think the key problem is that a large number of startups are shipping software in containers, and dotnet requiring a CLR is not particularly well-suited for containerization. It's like the old school Java JVM model. You have to ship a copy of the runtime with every container, and if you're doing proper microservices it's an awful lot of overhead.

    Yes I'm aware MS makes it easy to build containers and even single executables, but languages that compile down to an ELF are pretty much a requirement once your deployments are over the 10k containers mark.

    replies(11): >>45899527 #>>45900963 #>>45901005 #>>45901024 #>>45901026 #>>45901133 #>>45901711 #>>45901752 #>>45903133 #>>45904968 #>>45905736 #
    paride5745 ◴[] No.45899527[source]
    Exactly this point.

    Go and Rust produce native binaries, I wish C# had an official native compiler without the big runtime needs of .Net.

    replies(2): >>45899644 #>>45899673 #
    1. cachius ◴[] No.45899644[source]
    You might want to read https://learn.microsoft.com/en-us/dotnet/core/deploying/nati...

    Publishing your app as Native AOT produces an app that's self-contained and that has been ahead-of-time (AOT) compiled to native code. Native AOT apps have faster startup time and smaller memory footprints. These apps can run on machines that don't have the .NET runtime installed.

    replies(4): >>45900365 #>>45900449 #>>45900617 #>>45907144 #
    2. 4rt ◴[] No.45900365[source]
    They're self contained and native, but they're still massive.

    There's been some work on CoreRT and a general thrust to remove all dependencies on any reflection (so that all metadata can be stripped) and to get tree-shaking working (e.g. in Blazor WASM).

    It seems like in general they're going in this direction.

    replies(1): >>45901039 #
    3. skeeter2020 ◴[] No.45900449[source]
    There are quite a few gotchas for this, especially web apps. THis is understandable because it was added after the fact, vs. a first-party design requirement. It's cool and might work for you, but taking a non-trivial .net codebase to native AOT can be tough, and if you're starting greenfield, why go .net?
    replies(2): >>45901626 #>>45907021 #
    4. parliament32 ◴[] No.45900617[source]
    And this sounds great until you get to the laundry list of restrictions. For us the showstopper was you can't use reflection.
    replies(2): >>45900954 #>>45901075 #
    5. oblio ◴[] No.45900954[source]
    You can't use reflection with AOT compilation. That's what AOT compilation is. Java has the same limitation for AOT compilation, for example.
    6. greener_grass ◴[] No.45901039[source]
    Smaller is better, of course, but I've never found the size of .NET binaries to be an issue.

    What problems does this cause?

    replies(1): >>45901873 #
    7. alexandrehtrb ◴[] No.45901075[source]
    Most reflection usage is for JSON (de)serialization and for that you can use source generators, which also offer better performance.

    https://learn.microsoft.com/en-us/dotnet/standard/serializat...

    8. whizzter ◴[] No.45901626[source]
    Sure, legacy applications won't be easy to move over but Microsoft has been quite consistent in working towards making microservice applications easy to build and run with AOT by moving more and more components over to using source-generators and promoting minimal-API's.

    Their target is probably not entirely greenfield projects (although I wouldn't mind it myself), but rather those with existing investments that start new projects that still want to share some parts.

    9. 4rt ◴[] No.45901873{3}[source]
    If you're trying to pack hundreds of microservices into a cluster, having containers using 80MB of ram minimum instead of 500KB can become a big deal.
    10. el_benhameen ◴[] No.45907021[source]
    FWIW, the .net folks seem to have put a lot of effort into the native AOT pipeline in the last few releases. We have a large, non-trivial application with a fair amount of legacy code, and getting it AOT’d in .net 10 (targeting wasm, even!) was not an insane lift.
    replies(1): >>45907569 #
    11. midnitewarrior ◴[] No.45907144[source]
    Not every library is capable of building to Native AOT, which means any app that depends on those libraries run into the same problem. If the library or app uses reflection, it likely isn't capable of Native AOT compilation.
    12. leobuskin ◴[] No.45907569{3}[source]
    How is the WASM target looking nowadays? I tried it in 2023 and early 2024, and it was far from complete (JS interop, poor documentation scattered across GitHub issues, and so on). I still can't find a single trustworthy source of documentation on how to proceed. C# would look great at the edge (Cloudflare Workers).