<分区>
注意到 Java 中没有 async 和 await,ES7 中的这些新关键字是从 C# 语言复制而来的?我很好奇起源:谁提出了关键字名称,JS 社区中是否有人正在利用 .NET 框架的概念?
<分区>
注意到 Java 中没有 async 和 await,ES7 中的这些新关键字是从 C# 语言复制而来的?我很好奇起源:谁提出了关键字名称,JS 社区中是否有人正在利用 .NET 框架的概念?
最佳答案
使用 promises(或 futures 等)的概念正变得越来越流行,但这并不新鲜。例如,您可以在 MultiLisp 中找到它。
async
和 await
关键字最近在 C# 中使用,现在正在传播到许多其他语言中。
Several mainstream languages now have language support for futures and promises, most notably popularized by the
async
andawait
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++.
是的,JS 是从 C# 借来的。
关于javascript - ES7 中新的 async 和 await 关键字是从 C# 复制过来的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34206654/