Skip to content

Releases

First 0.4.0

Choose a tag to compare

@akkeshavan akkeshavan released this 01 Dec 13:39

Release 0.4.0

First 0.3.2

Choose a tag to compare

@akkeshavan akkeshavan released this 01 Dec 05:48

Release 0.3.2

First 0.3.1

Choose a tag to compare

@akkeshavan akkeshavan released this 01 Dec 04:32

Release 0.3.1

First 0.3.0

Choose a tag to compare

@akkeshavan akkeshavan released this 01 Dec 02:00

[0.3.0] — 2026-12-01

Highlights

0.3.0 closes the tactic gap with Lean 4. The proof system now has 68 built-in tactics — up from 30 in v0.2.0 — covering all of Lean 4's P1, P2, and P3 tactic categories. Every tactic is available in First source files today; interactive search tactics (exact?, apply?, simp?) are deferred to a future release.


Proof system — new tactics (38 additions)

Hypothesis management

  • clear h — remove a hypothesis from the proof context
  • revert x — move a hypothesis or variable back into the goal (reverse of intro)
  • generalize [h :] e = x — replace an expression with a fresh variable in the goal
  • subst h / subst_vars — substitute a variable equality from a hypothesis everywhere
  • rename_i x — rename an inaccessible (auto-generated) hypothesis
  • replace h : T — replace a hypothesis with a new type

Rewriting control

  • rw [...] at h / rw [...] at * — rewrite inside a hypothesis instead of the goal
  • simp only [h1, h2] — simp restricted to an explicit lemma list
  • simp at h / simp only [...] at h / simp at * — simp targeting specific hypotheses
  • simp_all — simp the goal and all hypotheses simultaneously
  • unfold f — unfold a definition in the goal
  • delta f — delta reduction (explicit unfolding)
  • change T — change the goal to a definitionally equal type
  • conv => { ... } — focused rewriting inside a subterm
  • reduce — normalize the goal by beta/delta/iota reduction

Pattern matching

  • rcases h with (a, b) — deep nested pattern matching on a hypothesis
  • rintro (a, b) — intro with immediate destructuring

Goal management

  • all_goals { t } — apply a tactic to every open goal
  • any_goals { t } — apply a tactic to any goal that accepts it
  • case name => { t } — select a named subgoal
  • done — assert all goals are closed; error if any remain
  • skip — no-op tactic
  • with_reducible { t } — run tactics under reducible transparency

Numeric and cast tactics

  • zify — convert Nat goals to Int
  • push_cast — push coercions inward
  • pull_cast — pull coercions outward
  • mod_cast — simplify goals with modular casts
  • linear_combination e — close a goal with an explicit linear combination certificate
  • fin_cases x — enumerate all cases of a Fin n variable
  • interval_cases x — case-split over a ≤ x ≤ b
  • native_decide — decide via native compiled code
  • norm_fin — normalize Fin n arithmetic
  • bitblast — bit-vector decision procedure

Typeclass and meta

  • infer_instance — close a typeclass/instance goal by synthesis
  • trace "msg" — emit a debug message during proof checking; leaves goal open

push_neg upgraded

Full De Morgan laws, iterated to fixpoint:
¬(A∧B) → ¬A∨¬B, ¬(A∨B) → ¬A∧¬B, ¬(P→Q) → P∧¬Q, ¬¬P → P


Developer experience

  • All 38 new tactics available in user-defined tactic declarations in First source files
  • Full pretty-printer support for all new tactics (LSP hover, error messages)
  • Parser supports simp only, simp at, rw at, rcases with (...), case name =>, conv => syntax

First 0.2.0

Choose a tag to compare

@akkeshavan akkeshavan released this 30 Nov 12:56

Changelog

All notable changes to the First compiler and standard library are documented here.


[0.2.0] — 2026-11-30

Highlights

0.2.0 is a major feature release. The language now has a complete proof system with 30+ tactics, dependent types, refinement types, compile-time metaprogramming, an LSP server, a VS Code extension, AI-powered error explanations, and a significantly expanded standard library covering algebra, analysis, topology, measure theory, and category theory.


Language

Dependent types

  • Vec<T, n> — length-indexed vectors; length checked at declaration site against array literals
  • Fin<n> — bounded naturals; plain i64 at runtime, constrained by the type system
  • Pi types — nat variables (n, m, n+1, …) unified across function parameters
  • Sigma / DPair types — mkSigma, projFst, projSnd
  • Type-level normalization — Vec<T, n+0> == Vec<T, n> handled by the type checker
  • Dependent pattern matching — [h|t] gives t the type Vec<T, n-1>
  • Computational rfl — theorem addZeroRight(n: Int) -> Eq(n+0, n) by { rfl; } works
  • Dependent records — field types may reference prior field values
  • Indexed inductive types — type T<A, n: Int> = ... user-defined ADTs with nat parameters
  • Type-level functions — typefun Foo<n: Int> = SomeType<n> (experimental)

Refinement types

  • {x: T | predicate} syntax with Z3-based discharge at assignment, call, and return sites
  • Counterexample output when a predicate is violated
  • Nat and Pos as refinement aliases in Prelude
  • Refinement subtyping via Z3 implication check
  • Float predicate support

Proof system

  • theorem name(params) -> Prop by { tactics; } declarations
  • axiom name(params) -> Prop; declarations
  • @[simp] simp lemma registry
  • 30+ built-in tactics: refl, rfl, decide, trivial, sorry, ring, omega, linarith, norm_num, simp, simp only, exact, assumption, have, rw, rw_rev, intro, induction, cases, obtain, use, apply, show, split, constructor, left, right, calc, by_contra, push_neg, contrapose, symm, exfalso, congr, specialize, discriminate, injection, absurd, norm_cast, field_simp, tauto, positivity, aesop, polyrith, fun_prop, gcongr
  • Tactic combinators: try, repeat, first | ..., <;>
  • User-defined tactics: tactic Name { body; } — module-exportable, composable

Type system

  • Higher-kinded types: F<_> kind annotations in interfaces; arity checking at implementation sites
  • Nested generic types: Array<Array<T>> and similar >> forms now parse correctly
  • Type classes: class Name<T> / instance Name<ConcreteType> / [Constraint<T>] on generic functions
  • derive(ToString) for record types

Metaprogramming

  • macro name($p1, $p2) -> Syntax { body } — compile-time macros written in First
  • quote { expr } — lifts an AST fragment to a Syntax value
  • $name / $(expr) — splices a Syntax value back into the AST
  • Syntax ADT: SAtom | SInt | SStr | SBool | SList | SNode(tag, children)
  • Macros run before type-checking; can pattern-match on Syntax constructors
  • export macro for module-level macros

Error handling

  • Result<T, E> in Prelude: Ok(T) | Err(E)
  • ? propagation operator in interactions

Other language features

  • loop { ... break; } with var for mutable state (interaction-only)
  • for-in over ranges and arrays
  • Range expressions: a..b, a..=b, a,b..c
  • Channel<T> with send/recv/select for concurrency
  • extern function / extern interaction FFI declarations
  • Prop sort (proof-irrelevant)
  • Universe polymorphism (Univ kind)

Standard library

New modules added in 0.2.0:

Module Contents
Nat Peano naturals, add/mul/sub/pred/leq, proved theorems
Int Ring axioms + proved lemmas
Real Opaque Real, field/order axioms
Rat MkRat(Int,Int), arithmetic, axioms
Complex MkComplex(Float,Float), field axioms
Bool 35+ proved theorems via decide
Set Set = MkSet(A→Bool), De Morgan axioms
List Nil|Cons, length/append/reverse/map/filter
Vec Vec<T,n> length-indexed, vzip, head, replicate
Fin Fin bounded naturals, mkFin, safeIndex
Eq Eq type and refl axiom
Prop Prop, True, False, And, Or, Not
Void Empty type
DPair Dependent pair Sigma type
Finset Finite Int sets (ISEmpty/ISCons)
GFinset Generic finite sets GSet[Equal]
Algebra Ring/Field/Ord/Equal type class hierarchy
NumberTheory GCD, primality, axioms
Tactics auto, auto_arith, simp_ring, and other tactic macros
Topology Open balls, continuity axioms
Analysis Limits, derivatives, integrals (axiomatized)
MeasureTheory Measures, Lebesgue integral (axiomatized)
CategoryTheory Objects, morphisms, functors, natural transformations
Macro Syntax ADT definition for metaprogramming
NatList Nat-specific list utilities

Modules present since 0.1.0 and further expanded: Prelude, Array, Math, Date, Strings, IO, Stdio, OS, Json, Http, HttpServer, Net, HashMap.


Tooling

  • first-lsp — LSP server with diagnostics, hover types, go-to-definition, and completion
  • VS Code extension — bundles first-lsp; available in editors/vscode/
  • firstc --format — source formatter
  • firstc --ai-errors — AI-powered error explanations via Anthropic, OpenAI, or DeepSeek
  • firstc --lib-path <dir> — repeatable extra library search path

Test suite

730 tests passing across 308 test cases (up from ~150 in 0.1.0).


Known limitations

  • Cross-module macros (macros imported from other modules) not yet supported
  • Interactive proof-state panel in LSP not yet implemented
  • Windows native build untested (WSL 2 is the recommended path on Windows)
  • Generic record field access on parameterized types has an IR gap

[0.1.0] — 2026-07-01 (initial release)

  • Core language: function, interaction, let, var, match, ADTs, records, generics, lambdas
  • Module system: import, export, module
  • Basic type system: Int, Float, Bool, Char, String, Array<T>, Option<T>
  • Interfaces (interface / implementation)
  • fir package manager: new, build, run, add, install, git dependencies
  • LLVM backend targeting native binaries
  • Homebrew formula (macOS); Linux install script
  • Initial stdlib: Prelude, Array, Math, Date, Strings, IO, Stdio, OS, Json, Http, HttpServer, Net, HashMap