Warning - This repository is no longer maintained. Instead, please use ESMeta, a rebranded version of JISET.
JISET is a JavaScript IR-based Semantics Extraction Toolchain. It is the first tool that automatically synthesizes parsers and AST-IR translators directly from a given language specification, ECMAScript.
Details of the JISET framework are available in our papers:
We explain how to install JISET with necessary environment settings from
scratch. Before installation, please download JDK 8 and
sbt
.
$ git clone https://github.com/kaist-plrg/jiset.git
Insert the following commands to ~/.bashrc
(or ~/.zshrc
):
# for JISET
export JISET_HOME="<path to JISET>" # IMPORTANT!!!
export PATH="$JISET_HOME/bin:$PATH" # for executables `jiset` and etc.
source $JISET_HOME/jiset-auto-completion # for auto completion
The <path to JISET>
should be the absolute path of the JISET repository.
sbt
$ cd jiset && git submodule init && git submodule update && sbt assembly
Extract and generate a model from ECMAScript 2021 (ES12 / es2021):
$ jiset gen-model -extract:version=es2021
# ========================================
# extract phase
# ----------------------------------------
# version: es2021
# parsing spec.html... (10,476 ms)
# ========================================
# gen-model phase
# ----------------------------------------
# generating models... (240 ms)
Create the following JavaScript file sample.js
:
// sample.js
var x = 1 + 2;
print(x);
Parse sample.js
:
$ jiset parse sample.js
# ========================================
# parse phase
# ----------------------------------------
# var x = 1 + 2 ; print ( x ) ;
Evaluate sample.js
:
$ jiset eval sample.js -silent
# 3.0
Show the details and final results of the evaluation of sample.js
:
$ jiset eval sample.js -debug
You can run the artifact with the following command:
$ jiset <sub-command> <option>*
with the following sub-commands:
help
shows the help message.extract
extracts an ECMAScript model from ecma262/spec.html
.gen-model
generates ECMAScript models.compile-repl
performs REPL for printing the compile result of a particular step.gen-test
generates tests with the current implementation as the oracle.parse
parses a JavaScript file using the generated parser.load
loads a JavaScript AST to the initial IR states.eval
evaluates a JavaScript file using the generated interpreter.filter-meta
extracts and filters out metadata of test262 tests.parse-ir
parses an IR file.load-ir
loads an IR AST to the initial IR states.eval-ir
evaluates an IR file.repl-ir
performs REPL for IR instructions.build-cfg
builds control flow graphs (CFGs).and global options:
-silent
does not show final results.-debug
turns on the debug mode.-interactive
turns on the interactive mode.-no-bugfix
uses the semantics including specification bugs.-time
displays the duration time.ECMAScript Debugger extends the interpreter of JISET to help you understand how a JavaScript Program runs in ECMAScript. Currently, it is in an alpha stage and supports only basic features such as:
A short introduction video is available.
You can try ECMAScript Debugger with the following instructions in the $JISET_HOME
directory:
First, you should check out to the editor
branch to use ECMAScript Debugger.
$ git checkout editor && git submodule update && sbt assembly
Next, you should start a server.
$ jiset web
Finally, start a debugger client.
$ cd web && npm install && npm start
We have the following future plans: