Putting in All the Stops: Execution Control for JavaScript

02/08/2018
by   Samuel Baxter, et al.
0

Scores of compilers produce JavaScript, enabling programmers to use many languages on the Web, reuse existing code, and even use Web IDEs. Unfortunately, most compilers expose the browser's compromised execution model, so long-running programs freeze the browser tab, infinite loops crash IDEs, and so on. The few compilers that avoid these problems suffer poor performance and are difficult to engineer. This paper presents Stopify, a source-to-source compiler that extends JavaScript with debugging abstractions and blocking operations, and easily integrates with existing compilers. We apply Stopify to 10 programming languages and develop a Web IDE that supports stopping, single-stepping, breakpointing, and long-running computations. For nine languages, Stopify requires no or trivial compiler changes. For eight, our IDE is the first that provides these features. Two of our subject languages have compilers with similar features. Stopify's performance is competitive with these compilers and it makes them dramatically simpler. Stopify's abstractions rely on first-class continuations, which it provides by compiling JavaScript to JavaScript. We also identify sub-languages of JavaScript that compilers implicitly use, and exploit these to improve performance. Finally, Stopify needs to repeatedly interrupt and resume program execution. We use a sampling-based technique to estimate program speed that outperforms other systems.

READ FULL TEXT

page 8

page 17

research
03/31/2020

An Open-Source, Industrial-Strength Optimizing Compiler for Quantum Programs

Quilc is an open-source, optimizing compiler for gate-based quantum prog...
research
05/06/2019

TryLinks: An interactive tutorial system for a cross-tier Web programming language

Links is a web programming language under development in Edinburgh aimed...
research
01/31/2019

Eliom: A Language for Modular Tierless Web Programming

Tierless Web programming languages allow programmers to combine client-s...
research
02/14/2020

Constructing Hybrid Incremental Compilers for Cross-Module Extensibility with an Internal Build System

Context: Compilation time is an important factor in the adaptability of ...
research
05/22/2023

Whose Baseline (compiler) is it anyway?

Compilers face a intrinsic tradeoff between compilation speed and code q...
research
09/19/2019

Supporting On-Stack Replacement in Unstructured Languages by Loop Reconstruction and Extraction

On-stack replacement (OSR) is a common technique employed by dynamic com...
research
11/23/2016

Browsix: Bridging the Gap Between Unix and the Browser

Applications written to run on conventional operating systems typically ...

Please sign up or login with your details

Forgot password? Click here to reset