explaingit

restsend/pipa

Analysis updated 2026-06-24

32RustAudience · developerComplexity · 4/5LicenseSetup · easy

TLDR

Small ES2023 JavaScript runtime written in Rust, around 5 MB, with built-in fetch, WebSocket, and a bytecode compiler that outputs .jsc files.

Mindmap

mindmap
  root((pipa))
    Inputs
      JS source files
      Bytecode jsc files
      Rust host code
    Outputs
      Evaluated JS values
      Compiled bytecode
      Disassembled output
    Use Cases
      Embed JS in Rust apps
      Run scripts on small devices
      Precompile bytecode for fast startup
    Tech Stack
      Rust
      rustls
      Cargo
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Embed a small JavaScript runtime in a Rust app and expose Rust functions as JS globals

USE CASE 2

Precompile JS to .jsc bytecode with pipa -compile for faster startup in production

USE CASE 3

Run async JS that uses fetch and WebSocket without pulling in Node or extra C libraries

What is it built with?

RustCargorustls

How does it compare?

restsend/pipageekgineer/needle-rstonbo-io/ursula
Stars322625
LanguageRustRustRust
Setup difficultyeasymoderatehard
Complexity4/54/55/5
Audiencedeveloperdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

cargo install pipa-js gives you the CLI, but using it as a library means matching Rust toolchain versions.

MIT license, you can use, modify, and ship it as long as you keep the copyright notice.

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.

Copy-paste prompts

Prompt 1
Show me a Rust example using pipa-js to call eval_async on a fetch script and read back the JSON response
Prompt 2
Walk me through pipa optimization levels O0 to O3 and when to use -diss to disassemble bytecode
Prompt 3
Compare pipa against QuickJS on the V8 benchmark scores and explain where pipa wins or loses
Prompt 4
Help me build pipa with the minimal feature set, no REPL or fetch, for a constrained device
Prompt 5
Register a Rust function called log as a JS global in pipa and call it from an async script

Frequently asked questions

What is pipa?

Small ES2023 JavaScript runtime written in Rust, around 5 MB, with built-in fetch, WebSocket, and a bytecode compiler that outputs .jsc files.

What language is pipa written in?

Mainly Rust. The stack also includes Rust, Cargo, rustls.

What license does pipa use?

MIT license, you can use, modify, and ship it as long as you keep the copyright notice.

How hard is pipa to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is pipa for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.