ESMeta is an ECMAScript Specification Metalanguage. This framework extracts a mechanized specification from a given version of ECMAScript specification (ECMA-262) and automatically generates language-based tools.
Details of the ESMeta are available in our papers:
- [ASE 2020] JISET: JavaScript IR-based Semantics Extraction Toolchain [old repo]
- [ICSE 2021] JEST: N+1-version Differential Testing of Both JavaScript Engines [old repo]
- [ASE 2021] JSTAR: JavaScript Specification Type Analyzer using Refinement [old repo]
- [ESEC/FSE 2022] Automatically Deriving JavaScript Static Analyzers from Specifications using Meta-Level Static Analysis [old repo]
Title: Filling the gap between the JavaScript language specification and tools using the JISET family
We explain how to install ESMeta with necessary environment settings from the scratch. Our framework is developed in Scala, which works on JDK 8+, including GraalVM. Before installation, please install JDK 8+ and sbt, an interactive build tool for Scala.
$ git clone https://github.com/es-meta/esmeta.git
Insert the following commands to ~/.bashrc
(or ~/.zshrc
):
# for ESMeta
export ESMETA_HOME="<path to ESMeta>" # IMPORTANT!!!
export PATH="$ESMETA_HOME/bin:$PATH" # for executables `esmeta` and etc.
source $ESMETA_HOME/.completion # for autocompletion
The <path to ESMeta>
should be the absolute path of ESMeta repository.
$ cd esmeta && git submodule update --init && sbt assembly
You can run this framework with the following command:
$ esmeta <command> <option>*
with the following commands:
help
shows the help message.extract
extracts specification model from ECMA-262 (ecma262/spec.html
).compile
compiles a specification to an IR program.build-cfg
builds a control-flow graph (CFG) from an IR program.parse
parses a JavaScript file.eval
evaluates a JavaScript file.web
starts a web server for interactive execution.
and global options:
-silent
does not show final results.-debug
turns on the debug mode.-log
turns on the logging mode.-time
displays the duration time.
We will import the conformance test synthesizer we developed in JEST.
We will import the type analyzer for ECMA-262 we developed JSTAR.
We will import the meta-level static analyzer for ECMAScript we developed JSAVER.
ECMAScript Double Debugger extends the JavaScript interpreter in ESMeta to help you understand how a JavaScript Program runs according to ECMA-262. Currently, it is in an alpha stage and supports only basic features such as:
- Step-by-step execution of ECMAScript
- Breakpoints by abstract algorithm names in ECMAScript
- Visualization of states like a call stack, an environment, and a heap of ECMAScript
- Line-by-line execution of JavaScript
You can start it with the following instructions:
# turn on server of the double debugger
$ esmeta web
# install the client-side application using NPM
$ git clone https://github.com/es-meta/esmeta-debugger-client.git
$ cd esmeta-debugger-client
$ npm i
# turn on the client-side application
$ npm start
A short introduction video is also available.
We will enhance it with the following features:
- Add more debugger features:
- Show a JavaScript state by refining an ECMAScript state.
- Record timestamps during execution for resume & suspend steps (especially for Generator).
- ...
- Show relevant Test262 tests for each algorithm step in the specification viewer.
- Show the type of each variable using the type analysis result of JSTAR.
- Live-edit of
ecma262/spec.html
in the specification viewer.