文件名称:Semantics of Asynchronous JavaScript
文件大小:571KB
文件格式:PDF
更新时间:2021-02-20 15:42:28
javascript
The Node.js runtime has become a major platform for de- velopers building cloud, mobile, or IoT applications using JavaScript. Since the JavaScript language is single threaded, Node.js programs must make use of asynchronous callbacks and event loops managed by the runtime to ensure appli- cations remain responsive. While conceptually simple, this programming model contains numerous subtleties and be- haviors that are de ned implicitly by the current Node.js implementation. This paper presents the rst comprehensive formalization of the Node.js asynchronous execution model and de nes a high-level notion of async-contexts to formalize fundamental relationships between asynchronous events in an application. These formalizations provide a foundation for the construction of static or dynamic program analysis tools, support the exploration of alternative Node.js event loop implementations, and provide a high-level conceptual framework for reasoning about relationships between the execution of asynchronous callbacks in a Node.js application.