kaist-plrg / jiset

JISET: JavaScript IR-based Semantics Extraction Toolchain
40 stars 8 forks source link

JISET: JavaScript IR-based Semantics Extraction Toolchain

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.

Publications

Details of the JISET framework are available in our papers:

Overall Structure

image

Installation Guide

We explain how to install JISET with necessary environment settings from scratch. Before installation, please download JDK 8 and sbt.

Download JISET

$ git clone https://github.com/kaist-plrg/jiset.git

Environment Settings

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.

Installation of JISET using sbt

$ cd jiset && git submodule init && git submodule update && sbt assembly

Simple Examples

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

Basic Commands

You can run the artifact with the following command:

$ jiset <sub-command> <option>*

with the following sub-commands:

and global options:

ECMAScript Debugger Guide

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.

debugger

How to Run

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

Future Plans

We have the following future plans: