Comment

Comment by toast0

> async/await is one product of a long line of thought that says "threads are too hard for programmers to get right".

Having used both threads and async/await and using them both in the same program, I don't see how async/await is supposed to make it easier to get right.

In my experience, async/await seems to be a solution to avoid running too many threads. In Javascript, because you could only have one thread in browsers; in other languages because thread per X is too many threads and queuing to a thread pool might not be desirable either.

Async/await always feels terrible to use though. Some other way to get thread like semantics without having to have OS threads for everything seems better (to me). Erlang processes, Java Loom Virtual Threads (which I haven't used), etc. If it avoids having all memory shared, even better.

parent toast0 1 month ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton