Skip to content

v0.4.0

Choose a tag to compare

@rendro rendro released this 08 Apr 23:39
· 493 commits to main since this release

Highlights

String Interning

All identifiers are now interned as Symbol(u32) — variable lookups, field access, and pattern matching use O(1) integer comparison instead of O(n) string comparison across the lexer, parser, compiler, and typechecker.

Architecture Improvements

  • VM split into 6 sub-modules: execute, dispatch, arithmetic, runtime, error, tests (was 5,500 LOC monolith)
  • Compiler split: pattern matching compilation extracted into compiler/patterns.rs
  • Unified module registry: vm/dispatch.rs now consumes module.rs — single source of truth for builtin functions
  • Extracted compile_file() in main.rs — eliminated 70-80% pipeline duplication
  • Removed dead concurrency opcodes — committed to builtin-based concurrency

Constant Pool Optimization

HashMap-based O(1) deduplication replaces O(n) linear scan for constants.

Testing

  • 1,353 tests (up from ~1,100)
  • Property-based tests via proptest: formatter idempotency, no-panic guarantees for lexer/parser/formatter (9,300+ generated inputs)
  • 4 cargo-fuzz targets: lexer, parser, formatter, roundtrip
  • CLI integration tests (15 tests)
  • REPL unit tests (16 tests) — also fixed has_unclosed_delimiters not detecting unclosed strings
  • Coverage CI via cargo-tarpaulin

Stdlib Completions

  • fs module: is_file, is_dir, list_dir implemented
  • regex module: captures, captures_all implemented
  • io.inspect and math.exp added to module registry (fixes aliased import bug)
  • REPL completions now dynamically generated from module registry

Bug Fixes

  • Two-tier float system: Float (finite) and ExtFloat (IEEE 754)
  • Checked integer overflow, negative index errors
  • Fixed type safety holes, range OOM, mutex poisoning cascades
  • Hex (0xFF), binary (0b1010), scientific (1.5e10) numeric literals
  • Helpful errors for spread syntax in records, non-callable types, undefined pin vars

Full Changelog: v0.3.0...v0.4.0