News for hackers. Stuff that matters.
Re:.NET 10 by lolive on Wednesday November 12, 2025 @05:12AM (#45898403)
Apart from [the equivalent of] records, I see nothing big.

Except...

this '''let! a = fetchA() and! b = fetchB()''' really puzzles me. Does C# have a high-level syntax for concurrency timing? [something that Java is strongly lacking, and that Typescript did solve with Promise.all(), which is an ugly syntax, from my perspective]

Any elaboration on this is very welcome.

Re:.NET 10 by adgjlsfhk1 on Wednesday November 12, 2025 @06:29AM (#45898872)
The inlining and escape analysis changes are fairly big from a performance perspective.

Also, C# doesn't need nearly as many massive changes like project Valhalla because they got a lot of those design choices right from day 1 (mostly by looking at what Java did that was dumb and avoiding it).

Re:.NET 10 by greener_grass on Wednesday November 12, 2025 @05:22AM (#45898482)
Here `a` and `b` can have different types:

    let! a = fetchA() and! b = fetchB()
Whereas `Promise.all` usually requires all promises to have the same type (returning a `List<T>` or even a `List<obj>`) .

See https://learn.microsoft.com/en-us/dotnet/fsharp/whats-new/fs...

Re:.NET 10 by ajifurai on Wednesday November 12, 2025 @07:59AM (#45899594)
Actually, TypeScript's `Promise.all` can handle different types too.

    const [a, b] = await Promise.all([fetchA(), fetchB()]); // => a: A, b: B
Re:.NET 10 by greener_grass on Wednesday November 12, 2025 @08:12AM (#45899723)
I am talking about C# / F# context where the lists must have homogeneous types.

That TypeScript supports this is yet more complexity introduced to usages of an API not designed around types.

Re:.NET 10 by JaggerJo on Wednesday November 12, 2025 @05:19AM (#45898449)
The code snippet is in F#. And F# has so called "computation expressions".
Re:.NET 10 by codeulike on Wednesday November 12, 2025 @05:21AM (#45898472)
I think thats F# not C#
Re:.NET 10 by whoisthemachine on Wednesday November 12, 2025 @08:48AM (#45900126)
As others point out, that's F#, but yes C# has `async`/`await`, and has all the `Promise` methods, just under the `Task` class instead (and with slightly different names/calling conventions through out).
Re:.NET 10 by vips7L on Wednesday November 12, 2025 @09:32PM (#45909797)
Java has had CompletableFuture::allOf for a long time. The new structured concurrency api also has the same capabilities of waiting for futures.