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.gitInsert 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 autocompletionThe <path to ESMeta> should be the absolute path of ESMeta repository.
$ cd esmeta && git submodule update --init && sbt assemblyYou can run this framework with the following command:
$ esmeta <command> <option>*with the following commands:
helpshows the help message.extractextracts specification model from ECMA-262 (ecma262/spec.html).compilecompiles a specification to an IR program.build-cfgbuilds a control-flow graph (CFG) from an IR program.parseparses a JavaScript file.evalevaluates a JavaScript file.webstarts a web server for interactive execution.
and global options:
-silentdoes not show final results.-debugturns on the debug mode.-logturns on the logging mode.-timedisplays 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 startA 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.htmlin the specification viewer.