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

That's exactly my point. It's not a language feature, it's a library. Haskell, F#, and any other language that supports monads (or as you say, first class continuations), have the ability to do async/await - in a way that appears first-class - but actually is just regular code.

C#, and other languages that have taken the C# approach [to async/await], don't have first class continuations (well, C# does with LINQ, but that compromises most ways the average OO dev works). They implement async/await with first-class keywords that indicate where to slice a method in two.

In my language-ext [1] project I have added the LINQ operators to `Task<T>` which allows C# tasks to be used in the same way that Async is done in F#.

[1] https://github.com/louthy/language-ext/blob/main/LanguageExt...




Do-notation is a language feature though, and that's a superset of async/await.

Incidentally there are papers that are trying to improve on async in C++ by trying to sneak in generalized do-notation.




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

Search: