Releases: jasisz/aver
Releases · jasisz/aver
Aver 0.11.0
Effectful functions get verified now — bind an oracle with
given, check the trace, or export the universal law to Lean & Dafny. Dafny caught up with Lean across every recursive shape.
Added
- Oracle law and trace docs/example —
docs/oracle.mdnow separates proof-orientedverify <fn> lawover explicit oracles from cases-formverify <fn> tracefor.result/.trace.*assertions. Addedexamples/formal/oracle_trace.avas the short runnable example. - Broader Oracle effect classification — Oracle now covers CLI input (
Console.readLine), disk operation/result effects, one-shot TCP (Tcp.send/Tcp.ping),Time.sleep, and terminal trace/input calls that do not depend on modal terminal state. - Dafny proof backend reaches feature parity with Lean on recursion. Shared recursion classifier (
codegen::recursion::detect) + AST transform now feed both backends. Dafny emits mutual-recursion SCCs as fuel-guardedfunction fn__fuel(fuel: nat, …) decreases fuel { … }pairs with plan-specific metrics, parallel to Lean'sdef fn__fuel (fuel : Nat) …. Shapes that admit no total default or use?that doesn't lower fall back tofunction {:axiom}— the Dafny analogue of Lean'spartial def. Lemmas over opaque fns short-circuit toassume {:axiom} <ensures>;, the Dafny analogue of Lean'ssorry. Across the 23 canonical examples: 12 are clean on both backends (full proof), 9 have matching proof gaps (Dafny axiom/assume vs. Lean sorry), 2 are pre-existing codegen gaps orthogonal to the recursion story.
Changed
- Effectful verification story — README, language guide, and proof-backend docs now distinguish Oracle verification for classified effects from record/replay for ambient state, persistent protocols, terminal modes, and server callbacks.
codegen::recursionmodule —RecursionPlanenum,ProofModeIssue, recursion classifier, andrewrite_recursive_calls_{body,expr}AST transform pulled out ofcodegen::leaninto the shared module. Lean and Dafny both consume it.RecursionPlan::IntAscendingnow holds the bound as an Aver AST node (Spanned<Expr>) instead of a Lean-rendered string — each backend renders it in its own idiom.
Aver 0.10.1
Added
aver run --expr '<call>'/--input-file PATH— record or run any function, not justmain. Pass a call likeaver run src/tax.av -e 'loadTaxRate("PL")' --record dir/and the recording'sentry_fnandinputare populated from the call;aver replaypicks it up unchanged. Repeat-eto batch. Supports literal, list/tuple, and ADT-constructor arguments (Result.Ok(5),Shape.Circle(1.0), nested). Function calls / arithmetic / variables in arg position stay out of scope — wrap them in a helper function and call that instead. The same capability is exposed in the playground's Trace panel.
Aver 0.10.0 "Telltale"
Tooling now shows its work — parse errors point at the exact token with a repair, audit runs three axes in one shot, and every program can be recorded & replayed in the browser.
Added
aver audit— one command that runs static checks, verify blocks, and format compliance together. CI-friendly exit code,--jsonfor pipelines.aver format --check/aver format --check --json— non-mutating format verification. Every rewrite reports a structuredFormatViolationwith a stableruleslug:tab-indent,bad-function-header,effects-unsorted,effects-reshape,verify-misplaced,excess-blank,module-intent-reshape,decision-inline,trailing-whitespace,missing-final-newline. Agents and linters can key off specific rules instead of free-text diffs.- Naming convention checker — flags non-camelCase functions / fields and non-PascalCase types / modules / variants as stable diagnostics (
bad-fn-name,bad-type-name,bad-module-name,bad-variant-name,bad-field-name). Runs as part ofaver checkandaver audit. - Canonical diagnostic bundle across every CLI command —
aver check --json,aver verify --json,aver why --json,aver audit --json,aver format --check --jsonall emitAnalysisReportNDJSON now. One schema,schema_version: 1, documented indocs/diagnostics-schema.md. - Reworked browser playground — multi-file editor, interactive record & replay, full parity with CLI audit / why / context / format. Go play.
Changed
- Format engine rewritten around structured violations — the formatter used to report "needs format" as opaque before/after diffs. Every normalization pass now tracks per-line rule violations with original source-line numbers, so
--checkoutput points at the exact line that needs the specific fix instead of dumping a reformatted file.needs-formatstays as the aggregate marker; eachFormatViolationrides alongside with its rule slug. - Effects list in
aver context—signatureis now params + return type only; effects live on the siblingeffectsarray. Lets renderers show them without duplicating! [...]on screen.
Fixed
- Parse errors landed on line 1:1 with no hint — the formatter stripped the real span and emitted a single red line that didn't tell you where or why. Now: real line/col pulled from the parser, source snippet with
^^^caret under the offending token (clamped to the last char for EOL errors like Unterminated string), and repair hints for common shapes (Expected '[' after '!'→! [Console.print, ...], missingmodule <Name>, map=>syntax, tuple-needs-2-elements, …). Time.sleepon wasm32-unknown-unknown panicked ("can't sleep") — the browser runtime now makes it a no-op; native builds keep real blocking sleep.
Aver 0.9.7
Changed
- Pre-compiled self-host —
--self-hostno longer generates Rust code and runscargo buildat runtime. The self-host interpreter is compiled as a[[bin]]target alongsideaver, socargo install aver-langprovides both binaries out of the box. No Rust toolchain needed at runtime. - Cargo package cleanup — published crate excludes
self_hosted/,examples/,tools/,editors/, etc. Onlysrc/and essentials ship. Self-host generated code lives insrc/self_host/.
Added
- Release script (
tools/release.py) — automates version bumps, self-host regeneration, playground rebuild, crates.io publish, and GitHub release creation.
Fixed
--self-hostcrash from crates.io install — the runtime codegen tried to readaver-rt/Cargo.tomlrelative to the installed crate source, which doesn't exist. Eliminated by removing runtime codegen entirely.- Rust codegen: TCO invariant hoisting of variant constructors — enum variant constructors (e.g.,
Val::ValStr) were hoisted as loop invariants, causing move errors in generated Rust. Now excluded alongside builtins.
Removed
- Runtime codegen pipeline for self-host (
build_self_host_binary, fingerprinting,cargo build --offlineinvocation).
Aver 0.9.6
Performance
- VECTOR_SET_OR_KEEP in-place mutation — fused
Option.withDefault(Vector.set(v, i, val), v)always has sole ownership; the opcode now mutates the vector directly at its arena slot. Vector get/set 5k: 17ms → 816µs (20× faster). - Skip promotion rewrite for bulk types without young refs — vectors/maps/tuples of inline ints skip O(n) per-element rewrite during young→yard promotion. Vector get/set 5k: 17ms → 12.6ms (−26%).
- VM arena in-place map rewrite — map promotion rewrites NanValue pairs in-place via
Rc::make_mutinstead of rebuilding the HashMap. Map build 5k: 24ms → 1.3ms (18.9×). COW ops inherit source allocation space, skipping redundant promotion.
Changed
- Unified symbol resolution for uppercase dotted paths —
classify_leaf_opnow classifies uppercaseExpr::Attrpaths (Option.None, variant constructors, module function refs) via three newLeafOpvariants instead of returningNone. Eliminates duplicate resolution logic from Rust and WASM backends. WASM backend now routesExpr::Attrthrough the shared IR layer.
Added
- WASM
Option.toResultbuiltin —Some(v) → Ok(v),None → Err(err_value).
Fixed
- WASM cross-module variant constructor resolution — hierarchical module paths like
Domain.Types.TaskStatus.Blockednow resolve correctly (previously only single-level bases worked). - Rust codegen: TCO invariant hoisting of builtin callees —
List.prependand similar builtin namespace refs were hoisted as standalone value expressions, generating invalid Rust. Now excluded from hoisting since they're compile-time constants.
Removed
- Dead
entry_has_young_refsfunction.
0.9.5
Changed
- Shared symbol layer — module visibility, type registration, and symbol resolution now go through a single shared layer (
src/visibility.rs). All backends consume the sameModuleExportsandSymbolRegistryinstead of building their own views. - Unified module loader —
load_module_tree()replaces independent loaders in the VM compiler and type checker. Proper circular-import detection and module-name validation everywhere.
Fixed
- WASM codegen wrong types for private module helpers — dependency modules with private functions returning non-Int types (e.g.
padTworeturningString) caused invalid WASM. Codegen now has full signatures for all emitted functions. - Rust codegen missing
Arc::new()for cross-module recursive types — self-host binary failed to compile from a clean cache (175 type errors). Constructor boxed-position lookup now handles qualified names.
Removed
- Suffix-matching heuristic in VM type resolution
- Dual-key registration in type checker (replaced by alias-based lookup)
- Checker's
ModuleSigCacheand cycle-detection stack (handled by shared loader)
v0.9.4 — Fix Rust codegen forwarded argument crash
Fixed
- Rust codegen crash with forwarded arguments —
aver compileandaver run --self-hostfailed on programs with forwarded local variables after the unified resolver change in 0.9.3.
v0.9.2 — WASM mutual TCO memory fix
Fixed
- WASM mutual TCO memory leak — dead temporaries accumulated across iterations in mutual tail-call loops. Replaced per-iteration skip threshold with watermark-based adaptive compaction. Game of Life editor loop now stable at ~15KB instead of growing to 10+ MB.
Added
$heap_ptrWASM export — modules export the bump allocator position for host-side memory inspection.- Playground memory display — live heap usage shown in status bar.
- Playground rogue touch controls — added descend stairs (>) button.
v0.9.1 — Aver Playground
Added
- Aver Playground — write and run Aver in the browser at averlang.dev. In-browser compiler, 7 playable games, source viewer, syntax highlighting.
Fixed
- WASM variant equality — nullary variants compare correctly.
- WASM variant display — shows type names instead of
Variant#0. - WASM
Console.readLine— properly wrapped inResult.Ok, blocking via SharedArrayBuffer.
v0.9.0 — VM-only backend
Changed
- VM is the default backend —
aver run,verify,replay, andreplnow use the bytecode VM directly. The--vmflag is no longer needed and has been removed.
Removed
- Tree-walking interpreter — ~7500 lines removed. The VM covers all use cases the interpreter handled.
Added
- WASM backend —
aver compile --target wasmandaver run --wasm. Ownaver/*import ABI with--adapter wasifor standalone wasmtime. Works with built-in host, browser JS shim, or custom host. - Browser WASM runner —
tools/wasm-runner/with terminal canvas rendering and keyboard input. aver-memorycrate — standalone NaN-boxed value representation and arena allocator.