Please use this identifier to cite or link to this item: https://doi.org/10.1145/3484272.3484968
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
education
functional languages
lambda calculus
semantics
JavaScript
stepper
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. https://doi.org/10.1145/3484272.3484968
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
URI: https://scholarbank.nus.edu.sg/handle/10635/200915
ISBN: 9781450390897
DOI: 10.1145/3484272.3484968
Appears in Collections:Staff Publications
Elements

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

OPEN

PublishedView/Download

SCOPUSTM   
Citations

1
checked on Dec 6, 2021

Page view(s)

24
checked on Dec 2, 2021

Download(s)

1
checked on Dec 2, 2021

Google ScholarTM

Check

Altmetric


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