What's new in the .NET 11 runtime

91 pointsposted 4 hours ago
by stevefan1999

28 Comments

wofo

2 hours ago

Awesome stuff, as usual in .NET releases! The runtime async support is surprising to me... I get that stack traces are more friendly without state machines in the code, but I didn't expect they could switch to a runtime version and have equivalent performance. Cool!

pjmlp

2 hours ago

They did that after the learnings with experiment of having a Erlang, Go, Java like implementation for async, await.

jayd16

an hour ago

Is this a joke, like "hen's teeth"? Those languages don't have async/await.

shellac

34 minutes ago

They don't need to mark functions as needing special compilation / rewriting to support asynchronous use since the runtime provides the necessary mechanism to pause and resume (e.g. stackful continuations). So 'async' is unnecessary and 'await' can be a library function (or remain a keyword of course).

HexDecOctBin

2 hours ago

Does runtime async mean stackful coroutines? It's not obvious what exactly the state machines are replaced by, if not automatically inserted yield() calls.

gdwatson

2 hours ago

I took it to mean that coroutines are still stackless but that yielding is now an operation the runtime knows about instead of being compiled out by the compiler.

SurajMishra

2 hours ago

For the features that overlap between golang and .Net, can someone please let me know why people choose .Net over golang for non legacy systems? As far as my limited knowledge goes, go is much more efficient in syntax and memory.

fabian2k

an hour ago

The languages are very different. C# has much more powerful abstractions and is a much larger language in general. That is both an advantage and a disadvantage. Modern C# is also very fast, I wouldn't bet on Go winning that comparison.

My experience with Go is a while back, before it got generics. While I liked the overall idea of a language with little syntax and a focus on simplicity, I didn't really like Go in the end. It was a weird mix of too low-level and high level code. It exposed low level details that I don't need to think about in C#, and it is missing convenient abstractions like LINQ.

Personally, I like async/await in C# more than Go concurrency. I know this is heretical here, but I don't care about function coloring or any of the abstract advantages of other concurrency approaches. Async/Await in C# works for me (in non-legacy code) and is easy to understand.

fodkodrasz

8 minutes ago

the main problem with the .net async/await is the immediate execution of a call returning a Task, without control over where it may execute. F#'s asnyc was way saner and easier to understand in my opinion.

I'd beg to differ on the easy to understand... last time i worked with this stuff like ConfigureAwait only has cargo cults and no real good explanation, and wasn't covered in any recent version of eg. CLR via C#... Distributed tracing and thread management were totally bitten by async, also the way iterators and LINQ were broken... that was when I got off the train, as it broke the best abstractions for line of business code so that instead of designing an IO pipeline lazy developers could simple put Task.Run around blocking IO calls at the bottom of the codebas, and ... yeah, we are back at function coloring.

This brings me to: I winder for what kind of apps did you find it a delight, because for extensive data wrangling leveraging multiple calls it was a pain.

fabian2k

3 minutes ago

You don't need ConfigureAwait() at all in modern C# (unless you're writing desktop UI code, I don't know enough about that to comment there). In a modern ASP.NET Core web application you don't care about which thread your Task executes, there is no synchronization context at all.

I'm using C# for the backend of a web application, not legacy but .NET Core from the start.

JamesSwift

43 minutes ago

Modern .net is surprisingly performant while also being very high level if needed. So it is very close to being a "learn once" ecosystem. This means you use it to write code for a much broader range of usecases than others, you will have a broader / more mature ecosystem than others, and your potential hiring market is more vast.

jeswin

an hour ago

Go is not much more efficient, compared to NativeAOT - though it can be faster in some areas. The big reason why someone would want to use C# is that it's a more expressive language. You can even write your DB queries with LINQ (C# lets you express code as data), making them type-safe.

bjoli

2 hours ago

Go isn't as much fun. And is usually slower for my work until I bump up the GC and then it uses roughly the same amount of memory.

I have also found c# async to be lighter than go's concurrency story, and dotnet11 is going to make that much more clear.

Now: I write software for fun, not for money.

SurajMishra

2 hours ago

So for a requirement where both golang and .net would suffice, would you choose .Net over golang?

bjoli

an hour ago

Yes. Unless I really need CSP, but then I would much rather use f#+hopac because CML is the bee's knees.

For general concurrency where async doesn't suffice, go is nicer than C#, but hopac is nicer than go.

If go had proper concurrentML I am pretty sure I would use go a lot more. Again: this is for hobby projects where I get to choose freely.

incidently

2 hours ago

I know it's not quite as important in the agentic world, but the .NET tooling (across Visual Studio, JetBrains Rider, and C# Dev Kit for VS Code) is just awesome. Some people might frown upon full-blown IDEs, but sometimes they're just incredibly handy.

xnorswap

an hour ago

Even the non-visual stuff is pretty awesome, claude is able to trace and profile .NET code without skills or MCPs.

bob1029

an hour ago

The tooling and development UX.

Put things like their remote debugging experiences side-by-side and you will quickly learn why some of us go for the Microsoft tools rather than the others.

pjmlp

2 hours ago

That is an urban myth, CLR was designed with support for C++ in mind.

Also Go is at the stage of C# .NET 2.0, and still plenty of lacking language features.

I really think the creator of C# made a disservice to the .NET community by picking Go for the Typescript rewrite.

netdevphoenix

30 minutes ago

Compare the ecosystems of .NET vs golang. No comparison whatsover. IoT, mobile, web (front and backend), cloud, etc. I think Go lacks variety and is more focused on traditional greybeard areas.

stackskipton

an hour ago

At former jobs, because people know it and switching from .Net <-> Go generally isn't worth the time to learn other language.

Sure, having a runtime is downside but difference in container size for your average CRUD App doesn't really matter. Performance IME is very similar.

Ops type here.

i_s

2 hours ago

Native interop is much better in .NET, that matters a lot for some systems.

pjc50

an hour ago

What's go's equivalent of LINQ?

moron4hire

12 minutes ago

In addition to what the others have said, I also enjoy the extremely robust ringtone reflection system in .NET. I don't know of any other systems that provide more complete detail. Maybe Java, though it's been a while since I've used it. It makes reflection in other languages feel prehistoricaly primitive.

netdevphoenix

33 minutes ago

To all the .NET outsiders, C# is indeed the .NET darling but you can also use F# if you feel like living in the future. Or VB if you feel nostalgic. So in .Net land, C# is not destiny. It is a choice

moron4hire

6 minutes ago

I feel like VB is a "better" Python for beginners and F# is a much better Python for data scientists.

The tooling ecosystem in Python is just so bad that I can barely stomach it after spending the last 20 years in .NET. At times, when supporting analysts at work wanting to write a little glue code, I've found their main complaint about C# is "curly braces" (which seems like a really odd thing to complain about, but ok) and I've found it easier to teach them a little VB than to figure out whatever the hell is going on with dependency and runtime version management in Python.

And then, for the folks who go deep on Python for ML tasks, I've mostly found them caring now about specific libraries than the language itself. I then show them how .NET has equivalent or better libraries available and that a lot of the code-golf stuff they do in Python has a much cleaner version in F#.

bob1029

2 hours ago

I am looking forward to async stack traces being more legible. It might encourage developers to actually read and use them.