Back to browse
GitHub Repository

javascript for 🐜's, a tiny runtime with big ambitions

305 starsC

Ant – A from-scratch JavaScript runtime in 9 MB

by theMackabu·May 9, 2026·8 points·4 comments

AI Analysis

●●●BangerWizardryBold BetShip It

Hand-written engine beats Bun on cold start with a 9 MB binary.

Strengths
  • Hand-written engine avoids V8 overhead, slashing binary size from 100MB to 9MB.
  • 5ms cold start benchmark verified with hyperfine, significantly beating Node and Bun.
  • Uses MIR backend for JIT instead of standard LLVM or proprietary compilers.
Weaknesses
  • 64% test262 pass rate means many modern JavaScript features still unsupported.
  • Targets WinterTC API, risking compatibility with existing Node.js npm packages.
Target Audience

Backend developers, CLI tool authors, embedded systems engineers

Similar To

Bun · Deno · Node.js

Post Description

Hey HN! I have been working on Ant for a while now, would love to share around now.

What is Ant? It's my JavaScript runtime, built from scratch over many hours of work. Much effort has gone into keeping the binary size small, around 9MB at the moment (6.5 MB with -Os). On my M4 Pro, the hono coldstart bench (examples/npm/hono/bench-coldstart.js) lands around 5ms, about 2.4x faster than bun, and 5.8x faster than node.

To keep things small, the engine ("Ant Silver") is hand-written, not a wrapper around V8/JSC/SpiderMonkey. The JIT is still a work in progress but it uses a fork of MIR as the backend.

Ant currently targets the WinterTC Minimum Common API, while also passing 100% the javascript-zoo compat-table tests, and is sitting around 64% on test262.

Why did I build Ant? Well, I wanted a runtime small enough to ship with CLI's and small Docker containers without having to drag along 50 to 100mb of just runtime. Ant in its current state is performant enough in some cases to compete with v8, but mostly in specific shapes.

Background on how it got here: https://themackabu.dev/blog/ant-part-two

Online demo shell/container: https://ant.ax

If anyone has questions about Ant, such as the engine, im happy to answer any of them! Feedback is also appreciated, if you run your own code and hit some edge case.

Similar Projects