Please use this identifier to cite or link to this item:
Title: A Stepper for a Functional JavaScript Sublanguage
Authors: Henz, Martin Joachim 
Tan, Thomas
Chua, Zachary
Jung, Peter
Tan, Yee-Jian
Zhang, Xinyi
Zhao, Jingjing
Keywords: programming environments
functional languages
lambda calculus
term graph rewriting
Issue Date: 20-Oct-2021
Publisher: ACM, New York, NY
Citation: Henz, Martin Joachim, Tan, Thomas, Chua, Zachary, Jung, Peter, Tan, Yee-Jian, Zhang, Xinyi, Zhao, Jingjing (2021-10-20). A Stepper for a Functional JavaScript Sublanguage. 2021 ACM SIGPLAN International SPLASH-E Symposium. ScholarBank@NUS Repository.
Abstract: The first two chapters of the introductory computer science textbook Structure and Interpretation of Computer Programs, JavaScript Edition (SICP JS), use a subset of JavaScript called Source §2. The book introduces the reduction-based “substitution model” as a first mental model for the evaluation of Source §2 programs. To support the learner in adopting this mental model, we built an algebraic stepper—a tool for visualizing the evaluation of Source §2 programs according to the model. As a sublanguage of JavaScript, Source §2 differs from other purely functional programming languages by using a statement-oriented syntax, with statement sequences, return statements, and block-scoped declarations. For the purpose of this tool description, we distill these distinguishing features—along with explicit recursion—into a Source §2 sublanguage that we call Source §0, and focus on a stepper for this language. We formalize the substitution model of Source §0 as a lambda-calculus-style reduction semantics that handles explicit recursion by term graph rewriting and faithfully implements the JavaScript specification, when restricted to that language. Our implementation of the stepper represents term graphs by persistent data structures that maximize sharing and enable random access to all steps. This work presents the first reduction-based semantics for a JavaScript sublanguage and the first algebraic stepper for a language with return statements and block-scoped declarations. The tool supports the learner with step-level explanations, redex highlighting, and function-level skipping and can also be used for teaching the applicative-order-reduction lambda calculus.
Source Title: 2021 ACM SIGPLAN International SPLASH-E Symposium
ISBN: 9781450390897
DOI: 10.1145/3484272.3484968
Appears in Collections:Staff Publications

Show full item record
Files in This Item:
File Description SizeFormatAccess SettingsVersion 
main.pdf1.65 MBAdobe PDF




checked on Dec 6, 2021

Page view(s)

checked on Dec 2, 2021


checked on Dec 2, 2021

Google ScholarTM



Items in DSpace are protected by copyright, with all rights reserved, unless otherwise indicated.