It began in C# in 2012 - 5 years before JavaScript. And C# does threads.
And made its way to JavaScript via Typescript (whose creator also created C#).
Yes, I remember when my head was blown when I finally understood what this new async/await thing is doing in C#. It was nice to observe other language adopt it with basically the same syntax (Javascript, Python, Hack, then Rust with slightly different syntax). I had some satisfaction that my language got it first
C# really helped to popularized asyc/await as language feature, even though F# had something similar first.
async in F# is not a language feature, it’s a library that leverages F# computation expressions (monads).
It’s also possible to do async-like behaviour - without the async/await language feature - in C# using LINQ; so you could argue C# has had the capability (like F#) since LINQ was released.
But, I believe C# was the first mainstream language to implement the async/await method-splitting coroutines state-machine (as a language feature)
Async is a special case of continuations. If you have fist class continuations (and monads do notation in practice gives you that), you hardly need async as a language feature.
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#.