Skip to content

Instantly share code, notes, and snippets.

@guest271314
Last active July 15, 2024 05:57
Show Gist options
  • Save guest271314/bd292fc33e1b30dede0643a283fadc6a to your computer and use it in GitHub Desktop.
Save guest271314/bd292fc33e1b30dede0643a283fadc6a to your computer and use it in GitHub Desktop.
A list of JavaScript engines, runtimes, interpreters

V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.

SpiderMonkey is Mozilla’s JavaScript and WebAssembly Engine, used in Firefox, Servo and various other projects. It is written in C++, Rust and JavaScript. You can embed it into C++ and Rust projects, and it can be run as a stand-alone shell. It can also be compiled to WASI; see our online demo.

The JavaScriptCore framework provides the ability to evaluate JavaScript programs from within Swift, Objective-C, and C-based apps. You can use also use JavaScriptCore to insert custom objects into the JavaScript environment.

ChakraCore is a JavaScript engine with a C API you can use to add support for JavaScript to any C or C compatible project. It can be compiled for x64 processors on Linux macOS and Windows. And x86 and ARM for Windows only. It is a future goal to support x86 and ARM processors on Linux and ARM on macOS.

QuickJS is a small and embeddable Javascript engine. It supports the ES2020 specification including modules, asynchronous generators, proxies and BigInt.

It optionally supports mathematical extensions such as big decimal floating point numbers (BigDecimal), big binary floating point numbers (BigFloat) and operator overloading.

Main Features:

  • Small and easily embeddable: just a few C files, no external dependency, 210 KiB of x86 code for a simple hello world program.
  • Fast interpreter with very low startup time: runs the 75000 tests of the ECMAScript Test Suite in about 100 seconds on a single core of a desktop PC. The complete life cycle of a runtime instance completes in less than 300 microseconds.
  • Almost complete ES2020 support including modules, asynchronous generators and full Annex B support (legacy web compatibility).
  • Passes nearly 100% of the ECMAScript Test Suite tests when selecting the ES2020 features. A summary is available at Test262 Report.
  • Can compile Javascript sources to executables with no external dependency.
  • Garbage collection using reference counting (to reduce memory usage and have deterministic behavior) with cycle removal.
  • Mathematical extensions: BigDecimal, BigFloat, operator overloading, bigint mode, math mode.
  • Command line interpreter with contextual colorization implemented in Javascript.
  • Small built-in standard library with C library wrappers.

txiki.js is a small and powerful JavaScript runtime. It targets state-of-the-art ECMAScript and implements many web platform features.

It's built on the shoulders of giants: it uses QuickJS-ng as its JavaScript engine and libuv as the platform layer.

Bun is an all-in-one toolkit for JavaScript and TypeScript apps. It ships as a single executable called bun.

At its core is the Bun runtime, a fast JavaScript runtime designed as a drop-in replacement for Node.js. It's written in Zig and powered by JavaScriptCore under the hood, dramatically reducing startup times and memory usage.

Node.js® is an open-source, cross-platform JavaScript runtime environment.

For information about supported releases, see the release schedule.

Next-generation JavaScript runtime

  • Secure by default
  • Native support for TypeScript and JSX
  • Testing, linting, formatting, and more out of the box
  • High performance async I/O with Rust and Tokio
  • Backwards compatible with Node.js and npm

An implementation of ECMA-262 in JavaScript

Goals

  • 100% Spec Compliance
  • Introspection
  • Ease of modification

Non-Goals

  • Speed at the expense of any of the goals This project is bound by a Code of Conduct.

Join us in #engine262:matrix.org.

JavaScript engine optimized for React Native

Duktape is an embeddable Javascript engine, with a focus on portability and compact footprint.

Duktape is easy to integrate into a C/C++ project: add duktape.c, duktape.h, and duk_config.h to your build, and use the Duktape API to call ECMAScript functions from C code and vice versa.

Main features

  • Embeddable, portable, compact: can run on platforms with 160kB flash and 64kB RAM
  • ECMAScript E5/E5.1, with some semantics updated from ES2015+
  • Partial support for ECMAScript 2015 (E6) and ECMAScript 2016 (E7), see Post-ES5 feature status and kangax/compat-table
  • ES2015 TypedArray and Node.js Buffer bindings
  • CBOR bindings
  • Encoding API bindings based on the WHATWG Encoding Living Standard
  • performance.now()
  • Built-in debugger
  • Built-in regular expression engine
  • Built-in Unicode support
  • Minimal, retargetable platform dependencies
  • Combined reference counting and mark-and-sweep garbage collection with finalization
  • Coroutines
  • Property virtualization using a subset of ECMAScript ES2015 Proxy object
  • Bytecode dump/load for caching compiled functions
  • Distributable includes an optional logging framework, CommonJS-based module loading implementations, etc
  • Liberal license (MIT)

MuJS is a lightweight Javascript interpreter designed for embedding in other software to extend them with scripting capabilities.

MuJS was designed with a focus on small size, correctness, and simplicity. It is written in portable C and implements ECMAScript as specified by ECMA-262. The interface for binding with native code is designed to be as simple as possible to use, and is very similar to Lua. There is no need to interact with byzantine C++ template mechanisms, or worry about marking and unmarking garbage collection roots, or wrestle with obscure build systems.

MuJS is developed and maintained by Artifex Software. It was originally developed for use with the MuPDF viewer, but is designed to be useful as an independent component.

The primary meeting place for the MuJS community is the #mupdf Discord channel.

MuJS is free open source software distributed under the ISC license.

Nashorn engine is an open source implementation of the ECMAScript Edition 5.1 Language Specification. It also implements many new features introduced in ECMAScript 6 including template strings; let, const, and block scope; iterators and for..of loops; Map, Set, WeakMap, and WeakSet data types; symbols; and binary and octal literals. It is written in Java and runs on the Java Virtual Machine.

Nashorn used to be part of the JDK until Java 14. This project provides a standalone version of Nashorn suitable for use with Java 11 and later.

Nashorn is free software, licensed under GPL v2 with the Classpath exception, just like the JDK.

(originally on Google Code)

This project aims to be an extremely simple (~2000 line) JavaScript interpreter, meant for inclusion in applications that require a simple, familiar script language that can be included with no dependencies other than normal C++ libraries. It currently consists of two source files: one containing the interpreter, another containing built-in functions such as String.substring.

TinyJS is not designed to be fast or full-featured. However it is great for scripting simple behaviour, or loading & saving settings.

I make absolutely no guarantees that this is compliant to JavaScript/EcmaScript standard. In fact I am sure it isn't. However I welcome suggestions for changes that will bring it closer to compliance without overly complicating the code, or useful test cases to add to the test suite.

Currently TinyJS supports:

  • Variables, Arrays, Structures
  • JSON parsing and output
  • Functions
  • Calling C/C++ code from JavaScript
  • Objects with Inheritance (not fully implemented) Please see CodeExamples for examples of code that works...

For a list of known issues, please see the comments at the top of the TinyJS.cpp file, as well as the GitHub issues

There is also the 42tiny-js branch - this is maintained by Armin and provides a more full-featured JavaScript implementation than GitHub master.

Elk is a tiny embeddable JavaScript engine that implements a small but usable subset of ES6. It is designed for microcontroller development. Instead of writing firmware code entirely in C/C++, Elk allows to add JavaScript customisations to the firmware developed in C - which is a great way to let customers to extend/customise device functionality.

Elk features include:

  • Cross platform. Works anywhere from 8-bit microcontrollers to 64-bit servers
  • Zero dependencies. Builds cleanly by ISO C or ISO C++ compilers
  • Easy to embed: just copy elk.c and elk.h to your source tree
  • Small and simple embedding API
  • Does not use malloc. Operates with a given memory buffer only
  • Small footprint: about 20KB on flash/disk, about 100 bytes RAM for core VM
  • No bytecode. Interprets JS code directly

Elk approach is different from other scripting environments like micropython, which provide a complete JS API for everything. Elk is completely bare, it does not even have a standard library. All required functionality is supposed to be imported from C/C++ firmware, and JS code simply orchestrates things. That leaves Elk very minimal and tunable.

Below is a blinky demonstration on a classic Arduino Nano board which has 2K RAM and 30K flash (see full sketch):

Rhino is an implementation of JavaScript in Java.

Napa.js is a multi-threaded JavaScript runtime built on V8, which was originally designed to develop highly iterative services with non-compromised performance in Bing. As it evolves, we find it useful to complement Node.js in CPU-bound tasks, with the capability of executing JavaScript in multiple V8 isolates and communicating between them. Napa.js is exposed as a Node.js module, while it can also be embedded in a host process without Node.js dependency.

17 Nov 2023

This project is not being actively maintained in it's current state. please see lo for a new, low-level JavaScript runtime i am working on. Very shortly this should be in a place where I will be able to "resurrect" the "just" project and base it on lo. Keep an eye out over coming weeks on twitter or come join us on discord to discuss the new work. 🙏 🚀

it's JavaScript Jim, but not as we know it. 👾

Elsa is a minimal JavaScript and TypeScript runtime written in Go. Built on top of quickjs and heavily inspired by Deno.

Features

  • URL imports.
  • useful Web APIs.
  • compiles TypeScript out of the box.
  • bundling. elsa bundle
  • compiling to native distributable binaries. elsa compile

This is an experimental Javascript lexer, parser and interpreter written in Rust. Currently, it has support for some of the language.

workerd (pronounced: "worker-dee") is a JavaScript / Wasm server runtime based on the same code that powers Cloudflare Workers.

You might use it:

  • As an application server, to self-host applications designed for Cloudflare Workers.
  • As a development tool, to develop and test such code locally.
  • As a programmable HTTP proxy (forward or reverse), to efficiently intercept, modify, and route network requests

Dune is an open-source, cross-platform, shell around the V8 engine, written in Rust and capable of running JavaScript (dah) and TypeScript code out of the box.

Developed completely for fun and experimentation.

mJS is designed for microcontrollers with limited resources. Main design goals are: small footprint and simple C/C++ interoperability. mJS implements a strict subset of ES6 (JavaScript version 6):

  • Any valid mJS code is a valid ES6 code.
  • Any valid ES6 code is not necessarily a valid mJS code.

On 32-bit ARM mJS engine takes about 50k of flash memory, and less than 1k of RAM (see intro article). mJS is part of MongooseOS, where it enables scripting for IoT devices.

A JavaScript engine for Internet of Things

JerryScript is the lightweight JavaScript engine intended to run on a very constrained devices such as microcontrollers:

  • Only few kilobytes of RAM available to the engine (<64 KB RAM)
  • Constrained ROM space for the code of the engine (<200 KB ROM)

The engine supports on-device compilation, execution and provides access to peripherals from JavaScript.

Espruino is a JavaScript interpreter for microcontrollers. It is designed for devices with as little as 128kB Flash and 8kB RAM.

njs is a subset of the JavaScript language that allows extending nginx functionality. njs is created in compliance with ECMAScript 5.1 (strict mode) with some ECMAScript 6 and later extensions. The compliance is still evolving.

J2V8 is a set of Java bindings for V8. J2V8 focuses on performance and tight integration with V8. It also takes a 'primitive first' approach, meaning that if a value can be accessed as a primitive, then it should be. This forces a more static type system between the JS and Java code, but it also improves the performance since intermediate Objects are not created.

We developed J2V8 as a high performance engine for our multi-platform mobile toolkit tabris.js and it is a great choice for executing JavaScript on Android devices.

Spiderfire is a Javascript runtime built with Mozilla's SpiderMonkey engine.

Spiderfire aims to disrupt the server-side Javascript runtime environment.

BESEN is an acronym for "B ero's E cma S cript E ngine", and it is a complete ECMAScript Fifth Edition Implemention in Object Pascal, which is compilable with Delphi >=7 and Free Pascal >= 2.5.1 (maybe also 2.4.1).

BESEN is licensed under the LGPL v2.1 with static-linking-exception.

Features

  • Complete implementation of the ECMAScript Fifth Edition standard
  • Own bytecode-based ECMA262-complaint Regular Expression Engine
  • Incremental praise/exact mark-and-sweep garbage collector
  • Unicode UTF8/UCS2/UTF16/UCS4/UTF32 support (on ECMAScript level, UCS2/UTF16)
  • Compatibility modes, for example also a facile Javascript compatibility mode
  • Bytecode compiler
  • Call-Subroutine-Threaded Register-based virtual machine
  • Context-Threaded 32-bit x86 and 64-bit x64/AMD64 Just-in-Time Compiler (a ARMv7 EABI JIT for ARM CPUs with VFPv3 instruction set is planned)
  • Constant folding
  • Dead code elimination
  • Abstract-Syntax-Tree based optimizations
  • Type inference (both exact and speculative)
  • Polymorphic Inline Cache based on object structure and property key IDs
  • Perfomance optimized hash maps
  • Self balanced trees (for example to sort on-the-fly linked list items of hash maps for very fast enumeration of array objects)
  • Easy native Object Pascal class integration (properties per RTTI and published methods per by-hand-parsing of the native virtual method table)

js evaluates JavaScript programs using the LibJS engine. If you pass it a path to a script file, it will execute that script. Otherwise, it enters the Read-Eval-Print-Loop (REPL) mode, where it interactively reads pieces (usually, single lines) of code from standard input, evaluates them in one shared interpreter context, and prints back their results. This mode is useful for quickly experimenting with LibJS.

Run help() in REPL mode to see its available built-in functions.

@isao
Copy link

isao commented Dec 14, 2023

There's also njs in nginx

@ishigo1987
Copy link

@BeRo1985
Copy link

BeRo1985 commented Feb 10, 2024

And BESEN is also missing, which was the first fully completed implementation of ECMAScript 5th Edition (complete ES5.1 with strict mode and so on) at the time.

https://github.com/BeRo1985/besen

@danielweck
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment