News for hackers. Stuff that matters.
Re:Niklaus Wirth has died by versteegen on Wednesday January 03, 2024 @09:15PM (#38862286)
> I ask because I've found `async/await` to just be an irritating overhead

Then what you want are coroutines[1], which are strictly more flexible than async/await. Languages like Lua and Squirrel have coroutines. I and plenty of other people thing it's tragic that Python and Javascripts added async/await instead, but I assume the reason wasn't to make them easier to reason about, but rather to make them easier to implement without hacks in existing language interpreters not designed around them. Though Stackless Python is a CPython fork that adds real coroutines, also available as the greenlet module in standard CPython [2], amazing that it works.

[1] Real coroutines, not what Python calls "coroutines with async syntax". See also nearby comment about coroutines vs coop multitasking https://news.ycombinator.com/item?id=38859828

[2] https://greenlet.readthedocs.io/en/latest/

Re:Niklaus Wirth has died by wglb on Wednesday January 03, 2024 @10:43PM (#38862737)
Bliss 36 and siblings had native coroutines.

We used coroutines in our interrupt rich environment in our real time medical application way back when. This was all in assembly language and the coroutines vastly reduced our multithreading errors to effectively zero. This is one place where C , claimed to be close to the machine falls down.

Re:Niklaus Wirth has died by kragen on Wednesday January 03, 2024 @11:17PM (#38862927)
interesting, i didn't even realize bliss for the pdp-10 was called bliss-36

how did coroutines reduce your multithreading errors

Re:Niklaus Wirth has died by wglb on Thursday January 04, 2024 @03:15PM (#38871674)
I’m working up a blog post and will let you know when it is ready. Not at my desk just now
Re:Niklaus Wirth has died by kragen on Thursday January 04, 2024 @03:58PM (#38872144)
that sounds awesome! i hope to have a chance to read it!