Search code examples
javascriptc#asynchronousasync-awaitecmascript-2016

Are the new async and await keywords in ES7 copied from C#?


Noticing that async and await aren't found in Java, where these new keywords in ES7 copied from the C# language? I'm curious as to the origin: Who proposed the keyword names and is someone in the JS community is leveraging concepts from the .NET framework?


Solution

  • The concept of using promises (or futures, etc.) is becoming more and more popular, but it isn't new. You can find it in MultiLisp for example.

    The async and await keywords however were used recently in C# and now are spreading into many other languages.

    Several mainstream languages now have language support for futures and promises, most notably popularized by the async and await constructions in .NET 4.5 (announced 2010, released 2012) largely inspired by the asynchronous workflows of F#, which dates to 2007. This has subsequently been adopted by other languages, notably Dart (2014), Python (2015), Hack (HHVM), and drafts of ECMAScript 7 (JavaScript), Scala, and C++.

    So yes, JS is borrowing from C#.

    From Futures and promises#History