Exceptional Continuations in JavaScript

Exceptional Continuations in JavaScript
复制标题

JavaScript 中的异常延续

DOI:
--
复制
发表时间:
2007
期刊:
影响因子:
--
通讯作者:
Florian Loitsch
Florian Loitsch
中科院分区:
--
文献类型:
--
作者:
Florian Loitsch

文献摘要

被引文献

相似文献

JavaScript 作为网站开发的主要语言,不具有延续性。然而,作为客户端-服务器通信的一部分,它们可以作为暂停当前正在运行的执行的手段。在本文中,我们介绍了基于异常的延续对 JavaScript 的适应。增强的技术涉及闭包和功能改进,可降低缺少 goto 指令的解决方法的成本。我们还提出了一种在非线性执行上下文中处理基于异常的延续的实用方法,这种情况经常由于回调而发生。我们的基准表明,在某些条件下,延续仍然很昂贵,但通常是可行的。特别是翻译为 JavaScript 的编译器可以从静态控制流分析中受益,从而降低延续成本。
JavaScript, the main language for web-site development, does not feature continuation. However, as part of client-server communication they would be useful as a means to suspend the currently running execution. In this paper we present our adaption of exception-based continuations to JavaScript. The enhanced technique deals with closures and features improvements that reduce the cost of the work-around for the missing goto-instruction. We furthermore propose a practical way of dealing with exception-based continuations in the context of non-linear executions, which frequently happen due to callbacks. Our benchmarks show that under certain conditions continuations are still expensive, but are often viable. Especially compilers translating to JavaScript could benefit from static control flow analyses to make continuations less costly.