Skip to content
项目

关于

为 🐜 打造的 JavaScript,一个志向远大的微型运行时

编程语言与运行时

这些数字如何统计

实测星标增长

24小时
0
7天
+4
15天
+4
1个月
+20

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

🐜 Ant

An ant carries 50× its weight. So does this one.

Ant is a lightweight, high-performance JavaScript runtime built from scratch,
made to carry more than it weighs without compromising performance.

import { statSync } from "fs";

const { size } = statSync(process.execPath);
console.log(`${(size / 2 ** 20).toFixed(2)} MB`);
$ ant size.js
10.44 MB

Table of contents

Why Ant?

Ant Node Bun Deno
Binary size ~10 MB ~140 MB ~61 MB ~77 MB
Cold start ~5 ms ~45 ms ~10 ms ~17 ms
Engine Ant Silver V8 JSC V8
JIT ✓ ✓ ✓ ✓
WinterTC conformant ✓ partial ✓ ✓

Ant is designed for environments where size and startup time matter: serverless functions, edge computing, embedded systems, CLI tools, and anywhere you'd want JavaScript but can't afford a 50MB+ runtime.

Ant Silver is an independent engine, not a wrapper around V8, JSC, or SpiderMonkey. The JIT compiler uses a fork of MIR, a lightweight backend that enables near-native performance.

Installation

curl -fsSL https://antjs.org/install | bash

Spec conformance

Ant targets the WinterTC Minimum Common API specification, the standard for server-side JavaScript interoperability developed by Ecma TC55.

Suite Pass rate Notes
compat-table 100% 1509/1509 (ES1–ES5, ES6, ES2016+, ESNext)
Temporal 100% 4603/4603 at revision 2026-08-10
test262 ~91.5% 49033/53578 run on 2026-11-30

Benchmarks

Cold start

Measures the time to import Hono, register routes, and exit. Each runtime loads the same bench-coldstart.js script from examples/npm/hono/ that creates a Hono app with two routes, prints "ready", and calls process.exit(0). No HTTP server is actually started, this isolates module resolution and initialization overhead.

Measured with hyperfine (10 warmup runs, 100 timed runs):

hyperfine --warmup 10 --runs 100 \
  'ant  examples/npm/hono/bench-coldstart.js' \
  'node examples/npm/hono/bench-coldstart.js' \
  'bun  examples/npm/hono/bench-coldstart.js' \
  'deno run --allow-read --allow-env examples/npm/hono/bench-coldstart.js'
Runtime Mean Min Max Memory Relative
Ant 4.6 ms 4.1 ms 5.5 ms 6.8 MiB 1.0
Bun 10.2 ms 8.1 ms 17.9 ms 18.1 MiB 2.2× slower
Deno 17.4 ms 15.4 ms 31.2 ms 31.2 MiB 3.8× slower
Node 44.5 ms 42.7 ms 48.0 ms 47.6 MiB 9.7× slower
Environment
Detail Value
Hardware Apple M5 Pro, 64 GB RAM, 18 cores
OS macOS 27.0.1 Golden Gate (26A434)
Ant 17.1.b9523ae1.0
Node 26.13.0
Bun 1.4.3
Deno 2.9.6

Building Ant

See BUILDING.md for instructions on how to build Ant from source and a list of supported platforms.

Docker Images

Pull the published image for linux/amd64 or linux/arm64.

docker pull themackabu/ant:latest
docker run --rm themackabu/ant:latest --version
docker run --rm -v "$PWD:/app" themackabu/ant:latest index.js

latest is a static musl build and can't load native addons. Use latest-glibc if you need them.

Both images run as nonroot (uid 65532). To write into a mounted directory, pass --user "$(id -u):$(id -g)".

You can also build the container from source:

docker build -f Dockerfile.musl -t ant .
docker run --rm ant --version
docker run --rm -v "$PWD:/app" ant index.js

Security

For information on reporting security vulnerabilities in Ant, see SECURITY.md.

Community

Contributing to Ant

We welcome contributions through pull request. See CONTRIBUTING.md for more details.
For information about the governance of Ant, see GOVERNANCE.md.

探索相关项目

加载中…