Code Monkey home page Code Monkey logo

esmeta's Introduction

ESMeta

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.


Publications

Details of the ESMeta are available in our papers:


PLDI 2022 Tutorial

Title: Filling the gap between the JavaScript language specification and tools using the JISET family


Installation Guide

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.

Download ESMeta

$ git clone https://github.com/es-meta/esmeta.git

Environment Setting

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.

Installation of ESMeta using sbt

$ cd esmeta && git submodule update --init && sbt assembly

Basic Commands

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.

Future Plans

Conformance Test Synthesizer for ECMAScript

We will import the conformance test synthesizer we developed in JEST.

Type Analyzer for ECMA-262

We will import the type analyzer for ECMA-262 we developed JSTAR.

Meta-Level Static Analyzer for ECMAScript

We will import the meta-level static analyzer for ECMAScript we developed JSAVER.

ECMAScript Double Debugger

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.

debugger

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.

esmeta's People

Contributors

h2oche avatar jhnaldo avatar p51lee avatar dimenerno avatar maokami avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.