Implementing a performant scheme interpreter for the web in asm.js. (September 2017)
- Record Type:
- Journal Article
- Title:
- Implementing a performant scheme interpreter for the web in asm.js. (September 2017)
- Main Title:
- Implementing a performant scheme interpreter for the web in asm.js
- Authors:
- Van Es, Noah
Stievenart, Quentin
Nicolay, Jens
D'Hondt, Theo
De Roover, Coen - Abstract:
- Abstract: This paper presents the implementation of an efficient interpreter for a Scheme-like language using manually written asm.js code. The asm.js specification defines an optimizable subset of JavaScript that has already served well as a compilation target for web applications where performance is critical. However, its usage as a human-writable language that can be integrated into existing projects to improve performance has remained largely unexplored. We therefore apply this strategy to optimize the implementation of an interpreter. We also discuss the feasibility of this approach, as writing asm.js by hand is generally not its recommended use-case. We therefore present a macro system to solve the challenges we encounter. The resulting interpreter is compared to the original C implementation and its compiled equivalent in asm.js. This way, we evaluate whether manual integration with asm.js provides the necessary performance to bring larger applications and runtimes to the web. We also refactor our implementation to assess how more JavaScript code can cohabit with asm.js code, improving maintainability of the implementation while preserving near-native performance. In the case of our interpreter, this improved maintainability enables adding more complex optimizations. We investigate the addition of function inlining, for which we validate the performance gain. Highlights: A novel approach to efficient language implementation on the web is presented. Integrating asm.jsAbstract: This paper presents the implementation of an efficient interpreter for a Scheme-like language using manually written asm.js code. The asm.js specification defines an optimizable subset of JavaScript that has already served well as a compilation target for web applications where performance is critical. However, its usage as a human-writable language that can be integrated into existing projects to improve performance has remained largely unexplored. We therefore apply this strategy to optimize the implementation of an interpreter. We also discuss the feasibility of this approach, as writing asm.js by hand is generally not its recommended use-case. We therefore present a macro system to solve the challenges we encounter. The resulting interpreter is compared to the original C implementation and its compiled equivalent in asm.js. This way, we evaluate whether manual integration with asm.js provides the necessary performance to bring larger applications and runtimes to the web. We also refactor our implementation to assess how more JavaScript code can cohabit with asm.js code, improving maintainability of the implementation while preserving near-native performance. In the case of our interpreter, this improved maintainability enables adding more complex optimizations. We investigate the addition of function inlining, for which we validate the performance gain. Highlights: A novel approach to efficient language implementation on the web is presented. Integrating asm.js in a JavaScript application can yield near-native performance. Frequently calling in and out asm.js components causes a significant overhead. Macros are proposed as a solution to write asm.js code by hand. Interoperability and optimal usage of asm.js and high-level JavaScript is discussed. … (more)
- Is Part Of:
- Computer languages, systems & structures. Volume 49(2017)
- Journal:
- Computer languages, systems & structures
- Issue:
- Volume 49(2017)
- Issue Display:
- Volume 49, Issue 2017 (2017)
- Year:
- 2017
- Volume:
- 49
- Issue:
- 2017
- Issue Sort Value:
- 2017-0049-2017-0000
- Page Start:
- 62
- Page End:
- 81
- Publication Date:
- 2017-09
- Subjects:
- Optimization -- JavaScript -- asm.js -- Interpreters -- Performance
68N15 -- 68N20
Programming languages (Electronic computers) -- Periodicals
Computer networks -- Periodicals
Computer architecture -- Periodicals
Computer systems -- Periodicals
Langage de programmation
Réseau d'ordinateurs
Architecture d'ordinateur
Périodique électronique (Descripteur de forme)
Ressource Internet (Descripteur de forme)
005.13 - Journal URLs:
- http://www.sciencedirect.com/science/journal/14778424/40 ↗
http://www.elsevier.com/journals ↗ - DOI:
- 10.1016/j.cl.2017.02.002 ↗
- Languages:
- English
- ISSNs:
- 1477-8424
- Deposit Type:
- Legaldeposit
- View Content:
- Available online (eLD content is only available in our Reading Rooms) ↗
- Physical Locations:
- British Library DSC - 3394.071000
British Library DSC - BLDSS-3PM
British Library STI - ELD Digital store - Ingest File:
- 7908.xml