Wintermute 0.3.1 — value model
Opens the 0.3.x transpiler-language line: the transpiler gains a value model,
without introducing control flow yet.
- Function parameters —
func Add(X, Y int) inttranspiles toadd(X, Y) ->.
Parameter names must be uppercase-leading (Erlang variables); lowercase is
rejected, never auto-capitalized. Exported functions now export with the
correct arityf/N(previously hardcodedf/0). - Trailing return —
return expras the last statement of a function body
emitsexpras the function's value. Early/multi-value returns are rejected,
pointing at 0.3.2 (they needcase/if). A return before a receive is
correctly rejected as a non-tail early return. - Local bindings —
Z := exprbecomes the Erlang matchZ = expr.
Re-assignment (=) and rebinding an already-bound name are rejected — Erlang
variables are immutable. - Calls with arguments —
f(A, B)transpiles tof(A, B), enabling
self-recursion emission (Erlang's last-call optimization is free). Non-trivial
recursion still awaits a base-case branch (case/if, 0.3.2).
Correctness is proven end-to-end by a new real-toolchain rung: a value-model
fixture transpiles and compiles with erlc to a .beam. Green unit tests alone
are not enough.
This is a review-clean, TDD-built branch: 5 subagent-driven tasks (fresh
implementer + two-stage review each), one Critical caught and fixed mid-branch
(return-before-receive), and a whole-branch opus review returning "ready to
merge". The transpiler is unchanged in scope beyond these four features; all
other constructs (operators beyond +, if/case/switch, guards, multi-value
return, cross-module calls) still error by design and are deferred to 0.3.2+.