Implementing Continuation Marks in Javascript
John Clements, Ayswarya Sundaram, David Herman · DigitalCommons - CalPoly (California State Polytechnic University) · 2008
MzScheme’s continuation marks provide a flexible mechanism for implementing a number of useful language features and tools. We demonstrate the simplicity and utility of continuation marks by adapting them for JavaScript as frame-based stack marks using the Rhino implementation, showing a simple model of their behavior, and using them to build a toy debugger. Along the way, we discover a few interesting things. First, it requires some thinking—but not much code—to add continuation marks to JavaScript. Second, coupling tail-calling with the “return” of statement-based languages leads to some interesting problems in formulating a semantics. Third, building a debugger based on continuation marks highlights (by its absence) the elegance of Scheme’s simple syntax and hygienic macro system. 1.
Cited by 15 works. Open-access PDF
Authors
References
- The Mechanical Evaluation of Expressions
- Revised 4 report on the algorithmic language scheme
- Extensible security architectures for Java
- Revised 5 report on the algorithmic language scheme
- Standard ML of New Jersey
- The revised report on the syntactic theories of sequential control and state
- Stack inspection
- Proper tail recursion and space efficiency
- PLT MzScheme: Language Manual
- A Debugger for Standard ML