Forge

Drop-in Rust compiler & build cache. Zero LLVM.

Illustration: raw code cubes passing through an isometric anvil forge into stacked native binaries and a shared cache vault

Swap cargo for forge. Forge replaces LLVM with a native Rust backend and adds a shared copy-on-write build store across every project and git worktree.

Why

Rust compiles through LLVM, and Cargo rebuilds every dependency per checkout and per git worktree. Waiting on builds and watching target/ directories eat tens of gigabytes slows down every iteration. Forge replaces both with a native compiler backend written in Rust and a content-addressed build store.

How it works

Forge drops in for cargo (forge build, forge test, forge run) with zero changes to Cargo.toml:

  • Native Rust backend: compiles MIR directly to AArch64, x86-64 and WebAssembly machine code with zero megabytes of libLLVM
  • Shared build store: ~/.forge/store deduplicates compiled crates across projects and git worktrees using APFS clonefile / hardlinks — a second worktree builds in 0.17 s instead of 7.11 s
  • Cross-compilation out of the box: 19 native targets including zero-setup static linux-musl (rust-lld), macOS, Windows MSVC and wasm32
  • Native hosts: runs natively without LLVM on macOS, Linux (arm64 & x86-64) and Windows

What comes with it

Built-in tools with zero extra installs: forge docker (deterministic BuildKit cache & native Linux builds), forge watch, forge test --fast (parallel process-per-test runner), forge size / bloat, forge timings, forge audit (RustSec + SBOM), forge unused, forge outdated, forge dist and -Z stack-protector + DWARF file:line:column debuginfo.

Try it

curl -fsSL https://raw.githubusercontent.com/0xtlt/forge/main/install.sh | sh

forge build --release

Open source since v0.1.0 — already compiles rustc itself (librustc_driver) in 72 s with 0 MB of LLVM.

Role
Author

Status
v0.1.0 · Open source

Built with
Rust

License
Apache 2.0 or MIT

Links
Website
GitHub

More projects

  • Illustration: a prism splits one beam into a phone, a tablet, a window and a watch

    Prism SDK

    One Rust codebase, native UI everywhere.

  • Illustration: a small shop standing on a laptop keyboard

    Local Storefront

    Shopify themes and apps on your machine, without Shopify.

  • Illustration: several small servers wired to one hub, and one line to a chat window

    MyMCPs

    Every MCP server behind one endpoint.