Hacker News new | past | comments | ask | show | jobs | submit login

Await-async is implemented with a runtime which uses a thread pool or a single thread and allocates work when needed on any thread and waits for IO to yield a result.

With threads you just fully control what blocking code is running on a single thread.

If you are just running computations (or reading files, as filesystem api are not async) it's simpler to just use threads.




> or reading files, as filesystem api are not async

This is interesting - all nodejs file system APIs are async by default.


That's because javascript as a whole is async by default. Which really makes me confused as to why javascript didn't just go the route of Go and eliminate the distinction instead of falsely creating it with syntax.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: