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

Wouldn't it be desirable to replace async with sync, then?

I'd rather dirty the signatures of blocking/synchronous methods then of the rest.



Sync is still much more common than async. I'd rather write `await { httpCall }` than `blockOn { 1 + 1 }`


That would make a lot of sense, but wouldn't be very practical to add in to an existing code base.


Unlike JS, most languages, including Rust, are not async by default, so this would not make sense.


How is JS async by default?


When people say this, they usually mean "a significant amount of things JavaScript is used for are asynchronous, and IO is virtually always asynchronous," rather than something more literal. The language has asynchronicity deep in its bones, even if it's not entirely made out of it.




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

Search: