Home - nus-cs4215/x-slang-t1-xz-jj GitHub Wiki
Welcome to the SICPy (x-slang) wiki!
This wiki serves as the source for the language specifications of SICPy as well as the reference for developers who are interested in extending SICPy Academy.
For more info about SICPy, please refer here.
You can now access SICPy here!
Overview
SICPy is a series of sublanguages of Python, adapted from the Source programming language used in the textbook Structure and Interpretation of Computer Programs, JavaScript Adaptation (SICP JS). This project comprises of two components, x-slang and x-frontend which makes up the SICPy Academy. The SICPy Playground comes with linting functionalities for better coding experiences.
SICPy
SICPy consists of five sublanguages of Python, i.e., from SICPy §0-§4.
The following pages define the scope of each respective chapters as well as links to their specifications in BNF:
Execution Flow
The following diagram illustrates the execution flow of the SICPy Playground.

First, upon receipt of the the user's code input from x-frontend, the call_variant function would handover the input to x-slang's runInContext along with context related info (i.e., variant of sublanguage used).
A pipeline of processes will then take place to process the provided SICPy program from the user, starting with the syntax validation process through ANTLR4. Subsequently, the abstract syntax tree in the form of Zephyr Abstract Syntax Description Language (ASDL) would be generated using Python's AST module. Using the generated AST, the syntax analysis process would take place, and only permitted syntaxes as defined in the respective sublanguage variants would pass. Depending on the variant/ sublanguage, specific predeclared names/ modules would be injected to the execution environment right before handing over the user's SICPy program for execution in Pyodide.js.
The result of the execution will then be returned to the call_variant function at x-frontend and the output is then displayed.
More detailed information can be found in their respective pages:
- x-frontend
- x-slang
Getting Started
To get started, check out the Quick Development Guide.
Further Enhancements
SICPy Academy is a work-in-progress. For TODOs/ issues related to SICPy (x-slang), checkout TODOs.md.
Slides
The slides used for the presentation on April 7, 2021 can be found here.