First is a functional language that compiles to native binaries via LLVM — with a built-in theorem prover. Write pure functions, then prove them correct, in the same file.
Compiles to optimised LLVM IR. Proofs are erased at compile time — zero runtime overhead. Ship the same binary you would from C or Rust.
Tactics like ring, omega, linarith, and simp let you prove properties of functions in the same source file — no separate proof tool.
Annotate any parameter as {x: T | predicate}. The compiler checks call sites with Z3. Contracts live in the type, not in test files.
Pass --ai-errors to get plain-English explanations of every type error from Claude, GPT-4o, DeepSeek, or Kimi — provider-agnostic, opt-in.
Pure function vs side-effecting interaction is enforced by the type system — no monads, no annotations, no discipline required.
Length-indexed vectors, sigma types, type-returning functions, universe polymorphism — without leaving the familiar C-style syntax.
# Homebrew (recommended) brew tap akkeshavan/first brew install first-compiler
Installs firstc, fir, and first-lsp. Requires Homebrew.
# Auto-detects x86_64 or aarch64 curl -sSfL https://raw.githubusercontent.com/akkeshavan/first/main/scripts/install-linux.sh | bash
Downloads from GitHub Releases. Installs to /usr/local (or ~/.local without sudo). Restart your terminal after.
firstc --version # first compiler 0.3.2 fir --help
fir new hello && cd hello && fir run
24 chapters across two parts: First as a programming language, then First as a theorem prover. All example code runs with fir run.
The compiler, standard library, language spec, test suite, and fir package manager. Targets macOS and Linux on x86_64 and arm64.
github.com/akkeshavan/first ↗Runnable fir projects for every chapter of this book, plus standalone applications: a blog-post verifier, theorem-proving applications, and type-level guarantee demos.
github.com/akkeshavan/first-examples ↗A growing library of formally stated mathematics: ring laws, number theory, linear algebra, analysis, topology, and combinatorics — over 20 mathematical domains.
github.com/akkeshavan/first-mathlib ↗The official book — 24 chapters plus appendices. All source is Markdown; contributions and corrections are welcome via pull request.
github.com/akkeshavan/first-book ↗