Skip to content

Sprout v0.1.0 — the freeze ❄️

Choose a tag to compare

@fizzexual fizzexual released this 13 Jun 11:20
· 9 commits to main since this release

Sprout v0.1.0 — the freeze ❄️

The first milestone meant to hold. After a long base-completion cycle — lambdas + closures, ranges + comprehensions, pattern matching, the pipe operator, multi-line literals, a real examples gallery, an O(1) map — the core now stops moving. Libraries and real programs can build on it without the ground shifting.

The headline: a garbage collector

Sprout's biggest known weakness — it leaked everything until the process exited — is gone.

A conservative mark-sweep GC now reclaims lists, maps, environments, and closures. A loop that used to leak gigabytes now runs in bounded memory; a REPL session or a long-running program stays healthy.

  • Safe by design — conservative root scanning means the collector cannot free a live object, even at the cost of holding a little extra.
  • Collects cycles — a self-referential map (m["self"] = m) or a self-capturing closure is reclaimed correctly.
  • Handles any depth — marking uses an explicit worklist, not recursion, so even a 200,000-deep nested structure collects without trouble.
  • Proven — the entire test suite + all 11 examples pass not just normally but under stress mode (collect on every statement, so any missing root would instantly crash). CI runs the whole suite under AddressSanitizer + stress together on every push.

Strings aren't collected yet (a deliberate, safe first step) — that's the next memory slice. See docs/gc-design.md.

Also in the freeze

  • Benchmarks (benchmarks/) — a reproducible suite that drove the v0.0.30 map hash index (O(n²) → O(1)) and now documents the GC's cost honestly (~1.5× on call-heavy code that now collects instead of leaking; near-zero elsewhere).
  • More real programs — the gallery grows to 11, including calc (a recursive-descent calculator with operator precedence and parentheses), budget, and stats.
  • Honest docs — the README, roadmap, and design notes all updated to describe the collector.

CI green on Linux, macOS, and Windows, plus the ASan + stress job. Windows installer attached.

What's next (post-0.1, and it won't change the frozen core's meaning): string collection, a web kind, a package manager, tooling.