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

It's sorta unfortunate magic because it's a special case in the compiler. Instead of having a general use monad-like syntax, "await" gets special treatment. Compare this to F#'s approach, where the equivalent feature (async in F#) is just a library.

The actual transformations should be quite straight forward and give you the "pyramid" code the article mentions.

The magic that will bite you isn't the transformation as much as the runtime library that handles threading and the hidden choices made for you there. For instance, in ASP.NET, doing fooAsync().Result causes a deadock.



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

Search: