News for hackers. Stuff that matters.
Re:A Design Space Exploration of Async/Await by rao-v on Friday September 11, 2026 @09:54PM (#49667872)
I remember being so mad years ago, coming from a pure CS background, when it dawned on me that async await was “mere” control flow and not actual parallelism.

It’s why I feel go (with go routines being the norm) is one of the few imperative languages that was designed vs. filling out a bunch of historical constraints (apologies this is not meant to trigger a language debate, just an idiosyncratic thought)

Re:A Design Space Exploration of Async/Await by kccqzy on Friday September 11, 2026 @10:42PM (#49668203)
Being mere control flow is a good thing: some async/await implementations are just desugared into a state machine anyways, and it totally works on a single thread. Early async/await in Python was just a small generalization of its existing generator mechanism, and nobody would think generators in Python enables parallelism: it was always a control flow construct. This cleanly demonstrates the separation between the concepts of concurrency versus parallelism.

And of course go routines and channels can also be desugared into mere control flow. That’s how ClojureScript does async.

Re:A Design Space Exploration of Async/Await by aw1621107 on Friday September 11, 2026 @10:02PM (#49667923)
> vs. filling out a bunch of historical constraints

Do you mind elaborating on this? I don't understand what you're trying to get at.

Re:A Design Space Exploration of Async/Await by rao-v on Saturday September 12, 2026 @12:42AM (#49668893)
Threads were historically expensive enough that “just spawn a thread” wasn’t a reasonable thing to do in many situations. Thread pools were sort of a last resort, and we ended up with control flow like objects (futures, await etc.) to multiplex concurrency without parallelism.

Go sort of asks why tho and just standardizes on go routines as a good abstraction over both concurrency and parallelism.

This is sorta true elsewhere too. Go rejects a lot of the machinery that OO languages seem to feel obliged to carry around - inheritance hierarchies, explicit interface implementation etc. For what it's worth, I don't write much go, and I don't think it's magical. I just like how clearly it revisited some basics.

Elsewhere on HA you’ll find my extended rant about how strange it is that we don't have a language that elegantly abstracts computation over threads, SIMD, GPUs etc. Compilers can do this sort of thing now, just not optimally.

Re:A Design Space Exploration of Async/Await by tcfhgj on Saturday September 12, 2026 @03:38AM (#49669939)
> Go sort of asks why tho and just standardizes on go routines as a good abstraction over both concurrency and parallelism.

if it is really that good, why didn't Rust adopt the same thing?

Re:A Design Space Exploration of Async/Await by bobnamob on Saturday September 12, 2026 @04:36AM (#49670310)
Different design goals, go ships with a runtime baked in, rust wanted an async design independent of runtime implementation that’d be usable in embedded contexts
Re:A Design Space Exploration of Async/Await by valcron1000 on Saturday September 12, 2026 @01:36PM (#49674874)
Was part of the initial design, but then the designers dropped the idea of a built-in runtime.
Re:A Design Space Exploration of Async/Await by jcranmer on Saturday September 12, 2026 @01:16AM (#49669070)
> Elsewhere on HA you’ll find my extended rant about how strange it is that we don't have a language that elegantly abstracts computation over threads, SIMD, GPUs etc. Compilers can do this sort of thing now, just not optimally.

Autoparallelization has been a hot topic for literally decades, quite possibly longer than you've been alive.

The problem is that the techniques you need to do to write good SIMD code versus good GPU code versus good multithreaded code versus distributed computation are all different. Taking just memory concerns: a SIMD code needs you to carefully arrange memory so that every thread is accessing an adjacent memory location. GPU code likes locality, but you have large group sizes that can share all the local memory pretty cheaply, and loading from global memory to local memory is relatively expensive, so now you have to do a lot of tuned blocking. With multithreaded code, you now want to avoid sharing between different threads (which generally requires distributing loop iterations among threads very differently). And with a distributed platform, now you're primarily worrying about the overhead of communication of data between different nodes, and you're trying to minimize that.

Re:A Design Space Exploration of Async/Await by mitxela on Saturday September 12, 2026 @03:18AM (#49669805)
Another axis: a GPU wants you to load a large batch of work and then start it - you can't be bouncing between CPU and GPU work all the time, but you can mix SIMD and non-SIMD instructions freely.
Re:A Design Space Exploration of Async/Await by rao-v on Saturday September 12, 2026 @02:46AM (#49669579)
There is better than even odds I'm older than you, so I'd recommend you rethink using phrases like "possibly longer than you've been alive", it's not ... polite regardless of people's age.

The point (and I'd encourage you to find that thread to not retread ground) is that we absolutely can compile most computation heavy code for these different targets reasonably well - what we cannot garentee is that the resulting code is optimal given context. But gosh we can do so much - I’d encourage you to look into in profile guided, target aware, and autotuning optimization etc. (and then of course, there are LLM guided optimizations, but that's a whole other kettle of fish)

Re:A Design Space Exploration of Async/Await by MintPaw on Sunday September 13, 2026 @09:02PM (#49690549)
It doesn't seem to me like you've described concepts that are all that different, loading from global memory is slow on the CPU too because often it requires some kind of barrier or lock. All techniques require you to pre-arrange memory, just in different sized blocks. And sharing data between "lanes" is always to be minimized. Different amount on different platforms ofc, but the ideas seem similar.