Immutable
release. Only release title and notes can be modified.
v1.5.0 — 2026-05-22
Added
Language Features
- Early return (
return expr) with bottom type (⊥) semantics ?operator forResultandOption— desugars to match + early returnlet-elsesyntax —let P = expr else { diverge }for refutable pattern bindingif letexpressions with chain support (if let Ok(x) = a && let Ok(y) = b { ... })tryblocks — createResultvalues without requiring function boundaries- Nested constructor patterns —
match xs { Cons(Pair(a, b), rest) => ... } - Named record constructors —
TypeName { field: value, ... }in synth mode - Record spread syntax —
{ ...base, field: new_value }functional record update - Generic type aliases —
type ParseResult<T> = Result<(T, Cursor), ParseError> - Nested tuple patterns in constructor arguments —
Ok((tok, cur))matching - Import aliasing —
use foo::Bar as Aliasrenaming in import declarations - Propositional equality type —
Eq<A, x, y>withReflconstructor for type-safe equality proofs natindeliminator — primitive recursion on natural numbers with motive-driven type checking- Motive type checking — eliminators (
natind,J) infer and check motive types for dependent elimination
Compilation & Performance
- Per-function codegen units with in-process parallel compilation via
std::thread::scope - In-process LLVM object emission — eliminates
.ll→llc→.oround-trip - Elaboration caching (three tiers: signature-only, full CoreDef body, compressed background writes)
- Warm-cache self-compile under 500ms (down from ~32 minutes cold)
- Static linking of
libtungsten_core— single binary, noLD_LIBRARY_PATHrequired - Musttail tail-call optimization — removes 64MB stack trampoline
- Basic escape analysis — non-escaping closures and ADT values stack-allocated
- Uncurried calling convention — direct multi-argument entry points for known-arity functions
- String concat FFI extraction with owned-left
reallocfast path for dead temporaries - Tail-recursive list operations — accumulator-passing rewrites prevent stack overflow in
tungsten1
Module System
- Three-phase per-module elaboration pipeline (Phase A / A.5 / B)
- Per-module import resolution with cross-module type and constructor stubs
- Single-owner monomorphization — each generic instantiation emitted exactly once
- Visibility enforcement: per-constructor, per-field, and
pub usere-export capping
Diagnostics & Tooling
- Multi-file diagnostic spans with secondary labels and elaboration trace
tungsten doctor suggest-tools— pattern-matching error → diagnostic command recommendations- Diagnostic sidecar process with LMDB-backed experience store for tool effectiveness tracking
- Compiler-embedded diagnostic hints (contextual suggestions in error output)
tungsten testcommand with test discovery,--filter,--module,--check-onlyexpect_type(expr, "T")— cost-3 compile-time type assertion (no codegen needed)expect_error(expr, "E0001")— cost-3 compile-time error code assertiontungsten diff types,diff core,diff abi,diff ir— structural comparison toolstungsten info type-encoding,info adt,info constructors,info cir sitestungsten doctor check-phase-invariants,check-fold-consistency,check-normalization-consistencytungsten cache clean/cache status— elaboration cache management- Chrome tracing profiling via
--features codegen,profile tungsten commands --tree— hierarchical command discovery- Benchmarking suite (7 benchmarks: Tungsten vs Rust) under
benchmarks/ - IR determinism verification — byte-identical
.lloutput from tungsten2/tungsten3 tungsten doctor check type forall-resolution— detect inner foralls blocking type extractiontungsten diff l1-l2-check— compare L1 andtungsten1check results on same source- Benchmark runner tool with evidence bundles, equivalence verification, and deep analysis mode
- Performance attribution profiling — LLVM IR structural comparison for benchmark explanations
- x86_64 devcontainer — QEMU-based cross-architecture testing for self-compiled binaries
- Publish/promote tool in Rust — tree-filtered commit replay with staging release verification
Self-Hosting
- L3 self-host typecheck parity —
tungsten1 checkpasses all 1962 L2 definitions with 0 errors - Self-hosted
.tgLLVM IR text emitter (1,393 lines across 13 files) - Milestones M4–M9 complete: closures, sums/case, full self-compile capability
- CIR (Codegen IR) with capture list population via free-variable analysis
Changed
- Module elaboration architecture: single-pass combined AST → three-phase per-module pipeline
- Codegen granularity: single monolithic
.ll→ per-function codegen units intarget/ll/ - Sum type representation: opaque
[N x i8]→{ i32, [N x i8] }tagged union (ABI-safe) - Recursive ADT encoding: single μ-binder → nested μ-binders for mutual recursion (Tarjan SCC)
- CLI namespace reorganization: flat commands → hierarchical (
info type,info codegen,info module,doctor check type, etc.) - Makefile: monolithic 680-line file → modular
.mksplits (core, usage, compiler, native, devcontainer, diagnostics, profiling, publishing, quality) - Parser: ~30 bespoke
ParseResult*ADTs → standardResult<(T, Cursor), ParseError>with?
Fixed
- Interpreter eliminator:
tungsten runnow returns correct values forif/else,match, and record projection - Self-hosted
runcodegen:tungsten1 runcorrectly projects record fields (Fst/Snd chain fix) - Error cascade: failed function bodies no longer invalidate signatures — error count drops from 527 to ~18
- ARM64 ABI: multi-variant ADT struct register decomposition no longer corrupts payloads
- x86_64 self-host: self-compiled binary passes all 10 examples on x86_64 Linux
- Stack overflow in double self-compile:
filter_trivia_accrewritten iteratively (was overflowing 8MB stack) - TyVar escape: 303 monomorphic definitions with free TyVars → 0 (mutual recursion encoding fix)
- Match arm type inference: multi-field constructor patterns now elaborate in check mode (not infer)
- Glob re-export duplicates: same-definition deduplication prevents spurious E0106 errors
- ADT constructor exports: constructors registered as importable value-level names
pub usere-exports: visibility and path-qualified submodule imports resolved- Nested directory module re-export ordering bug fixed
- Wildcard tuple projection:
let (_, n) = pairnow correctly projectssnd(notfst) - Generic type elaboration: duplicate constructor registration inflating variant counts
- Mono discovery: stdlib generic functions called from user code now correctly monomorphized
- L3 module ordering sensitivity: module splits no longer trigger false E0999 errors in
tungsten1 - L3 inner forall instantiation: polymorphic constructors in
Result<(List<T>, Cursor), E>patterns resolve correctly - Nested constructor+tuple pattern codegen:
tungsten1now binds variables fromOk((a, b))patterns
Removed
- 64MB pthread stack trampoline (replaced by musttail TCO)
- Module flattening pass (replaced by per-module elaboration)
build_combined_source_file(replaced by three-phase pipeline)- ~30 bespoke
ParseResult*ADT types (replaced by standardResult)