explaingit

restsend/pipa

32Rust

TLDR

pipa is a small JavaScript runtime written in Rust.

Mindmap

A visual breakdown will appear here once this repo is fully enriched.

In plain English

pipa is a small JavaScript runtime written in Rust. It implements the ES2023 version of the JavaScript language, so modern syntax including async and await works out of the box without a separate compile step. The whole runtime ships as a single binary of around 5.2 MB when the REPL feature is included. A notable design point is that the things you would normally bring in as C libraries are reimplemented in Rust from scratch. That covers the regex engine, JSON, Base64, BigInt, Unicode tables, an HTTP client behind the global fetch, WebSocket, and Server-Sent Events. The fetch client uses rustls for TLS. The README states this means no external C libraries or system dependencies for those features. pipa can also compile JavaScript into a bytecode format with a .jsc extension. You can run a .js file directly, or pre-compile it with pipa -compile input.js output.jsc and then run the .jsc, which is faster to load. There are optimization levels from -O0 to -O3, with -O2 as the default, and a -diss flag to disassemble bytecode for debugging. The README publishes a benchmark table from the V8 benchmark suite, comparing pipa against QuickJS, Node, and Boa, where higher scores are better. The total score puts Node first by a large margin at 54,642, pipa second at 1,256, QuickJS third at 1,219, and Boa fourth at 203. The author's framing is that pipa edges out QuickJS while staying small. pipa can be installed as a command line tool with cargo install pipa-js, or used as a Rust library by adding pipa-js to Cargo.toml. The README shows short Rust snippets for evaluating JavaScript, reading values back, registering Rust functions as JS globals like print, running async code with eval_async plus an event loop, and compiling expressions to register-based bytecode. The default build includes REPL, fetch, and process support, with a minimal feature-stripped build also documented. The license is MIT.

Open on GitHub → Explain another repo

Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.