有效地编译尾部调用和JavaScript的延续

Eric Thivierge, M. Feeley
{"title":"有效地编译尾部调用和JavaScript的延续","authors":"Eric Thivierge, M. Feeley","doi":"10.1145/2661103.2661108","DOIUrl":null,"url":null,"abstract":"This paper describes an approach for compiling Scheme's tail calls and first-class continuations to JavaScript, a dynamic language without those features. Our approach is based on the use of a simple custom virtual machine intermediate representation that is translated to JavaScript. We compare this approach, which is used by the Gambit-JS compiler, to the Replay-C algorithm, used by Scheme2JS (a derivative of Bigloo), and Cheney on the MTA, used by Spock (a derivative of Chicken). We analyse the performance of the three systems with a set of benchmark programs on recent versions of four popular JavaScript VMs (V8, SpiderMonkey, Nitro and Chakra). On the benchmark programs, all systems perform best when executed with V8 and our approach is consistently faster than the others on all VMs. For some VMs and benchmarks our approach is moderately faster than the others (below a factor of 2), but in some cases there is a very large performance gap (with Nitro there is a slowdown of up to 3 orders of magnitude for Scheme2JS, and up to 2 orders of magnitude for Spock).","PeriodicalId":113092,"journal":{"name":"Scheme and Functional Programming","volume":"41 Suppl 1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2012-09-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":"{\"title\":\"Efficient compilation of tail calls and continuations to JavaScript\",\"authors\":\"Eric Thivierge, M. Feeley\",\"doi\":\"10.1145/2661103.2661108\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"This paper describes an approach for compiling Scheme's tail calls and first-class continuations to JavaScript, a dynamic language without those features. Our approach is based on the use of a simple custom virtual machine intermediate representation that is translated to JavaScript. We compare this approach, which is used by the Gambit-JS compiler, to the Replay-C algorithm, used by Scheme2JS (a derivative of Bigloo), and Cheney on the MTA, used by Spock (a derivative of Chicken). We analyse the performance of the three systems with a set of benchmark programs on recent versions of four popular JavaScript VMs (V8, SpiderMonkey, Nitro and Chakra). On the benchmark programs, all systems perform best when executed with V8 and our approach is consistently faster than the others on all VMs. For some VMs and benchmarks our approach is moderately faster than the others (below a factor of 2), but in some cases there is a very large performance gap (with Nitro there is a slowdown of up to 3 orders of magnitude for Scheme2JS, and up to 2 orders of magnitude for Spock).\",\"PeriodicalId\":113092,\"journal\":{\"name\":\"Scheme and Functional Programming\",\"volume\":\"41 Suppl 1 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2012-09-09\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"3\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Scheme and Functional Programming\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/2661103.2661108\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Scheme and Functional Programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2661103.2661108","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

摘要

本文描述了一种将Scheme的尾部调用和一级延续编译到JavaScript的方法,JavaScript是一种没有这些特性的动态语言。我们的方法是基于使用一个简单的自定义虚拟机中间表示,它被翻译成JavaScript。我们将Gambit-JS编译器使用的这种方法与Scheme2JS (Bigloo的衍生物)和MTA上的Cheney (Spock (Chicken的衍生物))使用的Replay-C算法进行比较。我们在四个流行的JavaScript虚拟机(V8, SpiderMonkey, Nitro和Chakra)的最新版本上使用一组基准程序分析了这三个系统的性能。在基准测试程序中,所有系统在使用V8时都表现最佳,并且我们的方法在所有vm上始终比其他方法更快。对于一些虚拟机和基准测试,我们的方法比其他方法要快一些(低于2倍),但在某些情况下,性能差距非常大(使用Nitro时,Scheme2JS的速度下降了3个数量级,而Spock的速度下降了2个数量级)。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Efficient compilation of tail calls and continuations to JavaScript
This paper describes an approach for compiling Scheme's tail calls and first-class continuations to JavaScript, a dynamic language without those features. Our approach is based on the use of a simple custom virtual machine intermediate representation that is translated to JavaScript. We compare this approach, which is used by the Gambit-JS compiler, to the Replay-C algorithm, used by Scheme2JS (a derivative of Bigloo), and Cheney on the MTA, used by Spock (a derivative of Chicken). We analyse the performance of the three systems with a set of benchmark programs on recent versions of four popular JavaScript VMs (V8, SpiderMonkey, Nitro and Chakra). On the benchmark programs, all systems perform best when executed with V8 and our approach is consistently faster than the others on all VMs. For some VMs and benchmarks our approach is moderately faster than the others (below a factor of 2), but in some cases there is a very large performance gap (with Nitro there is a slowdown of up to 3 orders of magnitude for Scheme2JS, and up to 2 orders of magnitude for Spock).
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信