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

> As soon as you have an `await` anywhere in the code, you've got to assume that your code will be re-entered.

At least the re-entry points are explicitly marked with `await`. IMO that's the main benefit of async-await (stackless coroutines) over stackful coroutines or threads, which allow your code to be suspended and re-entered almost anywhere.

Of course the drawback of async-await is the "function color" issue [0], in which it's difficult for functions that don't suspend to call those which do.

[0] http://journal.stuffwithstuff.com/2015/02/01/what-color-is-y...



That's a good perspective.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: