Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I guess I'll take this occasion to post this: http://journal.stuffwithstuff.com/2015/02/01/what-color-is-y...

Which argues that async/await might not be what we really want in the end. As a user of Promises and async/await in the future, it's a very interesting read!



It's a great blog post, but be careful what you wish for. If you have true preemptive threading as in Java or Go, a race condition can happen anywhere. I suspect many JavaScript developers would be sad about not having atomic event handling by default and having to learn to code much more carefully.

Even in Java UI frameworks like on Android or Swing, you have an event loop with a single thread, and when spawning another thread you have to deal with special communication layers [1]. True multithreaded UI's seem like an area for research.

[1] https://developer.android.com/training/multiple-threads/comm...


Yeah, the event loop can be a constraint but it's easier to think about and harder to mess up compared threads or channels. And really how much are you giving up? Most of the things you actually want to wait on have an async api. Maybe I just haven't built complex enough things, but I've never had to reach for web workers because of performance concerns.




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

Search: