News for hackers. Stuff that matters.
Re:dotNET (OK, C#) gets union types by lenkite on Sunday May 24, 2026 @04:58AM (#48255717)
Java Virtual Threads are a superior paradigm to C#'s async/await and function coloring.
Re:dotNET (OK, C#) gets union types by mrsmrtss on Sunday May 24, 2026 @06:59AM (#48256255)
I don't get what the big problem is with function coloring. You basically only need async when doing IO, and you had better know when a function does it, or you may have a bad surprise at some point in the future.
Re:dotNET (OK, C#) gets union types by oaiey on Sunday May 24, 2026 @07:56AM (#48256535)
That! Okay, in 2026 this could be a LSP feature with some editor fanciness but this is a real benefit. My nitpick is that we do not have a depreciation on the non async ones
Re:dotNET (OK, C#) gets union types by nchie on Sunday May 24, 2026 @11:25AM (#48258012)
Agreed, async function coloring makes for better structured code because it incentivizes keeping IO code near the edges while having a synchronous core.
Re:dotNET (OK, C#) gets union types by hackerqwe on Sunday May 24, 2026 @05:41AM (#48255921)
Clearly legacy heavy weight threads, virtual or not, are not superior. That’s why Swift, Rust and Typescript all chose async/await for concurrency.
Re:dotNET (OK, C#) gets union types by lenkite on Sunday May 24, 2026 @05:46AM (#48255943)
We are not taking about legacy heavy weight OS/platform threads. But "green" threads managed by the language runtime like Go. Java went the Go/Erlang way.

https://javapro.io/2026/03/05/java-25-and-the-new-age-of-per...

https://docs.oracle.com/en/java/javase/26/core/virtual-threa...

Re:dotNET (OK, C#) gets union types by kdps on Sunday May 24, 2026 @06:47AM (#48256188)
> Clearly legacy heavy weight threads, virtual or not, are not superior.

Associating virtual threads with "legacy heavy weight threads" is a fundamental misunderstanding

> That’s why Swift, Rust and Typescript all chose async/await for concurrency.

And Java chose to join Team Go/Erlang. At the end of the day, async/await is just syntactic sugar for futures/promises, which are essentially a way out of callback hell.

Besides, Rust and Typescript aren't good examples here: a green-thread scheduler (a runtime component) contradicts Rust's philosophy, while Typescript is inherently constrained by Javascript.

Re:dotNET (OK, C#) gets union types by pjmlp on Sunday May 24, 2026 @06:04AM (#48256006)
Except one of the milestones for .NET 11 is to offer similar mechanisms for async/await.
Re:dotNET (OK, C#) gets union types by biglyburrito on Sunday May 24, 2026 @07:49AM (#48256499)
Link?
Re:dotNET (OK, C#) gets union types by pjmlp on Sunday May 24, 2026 @08:59AM (#48256932)
It starts with the experiment,

https://github.com/dotnet/runtimelab/issues/2398

Which ended with,

> We have chosen to place the green threads experiment on hold and instead keep improving the existing (async/await) model for developing asynchronous code in .NET. This decision is primarily due to concerns about introducing a new programming model. We can likely provide more value to our users by improving the async model we already have. We will continue to monitor industry trends in this field.

Now three years later we have,

https://github.com/dotnet/core/blob/main/release-notes/11.0/...

> Runtime async is a major runtime feature in .NET 11 that introduces new runtime-level infrastructure for async methods. The goal is to improve tooling and performance for async-heavy codepaths. For more details and to track progress, see the Runtime Async epic issue.

Re:dotNET (OK, C#) gets union types by biglyburrito on Monday May 25, 2026 @11:24AM (#48267954)
Awesome, thank you!

So it's going to be an internal implementation change -- that is, it generates the MSIL code that's generate when a developer writes async/await code, and won't require changes to how a developer writes async/await code?

Re:dotNET (OK, C#) gets union types by youre-wrong3 on Sunday May 24, 2026 @05:57AM (#48255973)
Hahahha no. lol just no.
Re:dotNET (OK, C#) gets union types by OneWingedShark on Sunday May 24, 2026 @03:35PM (#48260313)
Both are, IMO, inferior to Ada's TASK construct.