Skip to content

Wintermute 0.2.7 — native Erlang interop (whole-module escape hatch)

Choose a tag to compare

@bsmr bsmr released this 12 Jul 19:39

Make Wintermute Go-first but Erlang-capable: wm build/wm release now accept
hand-written .erl modules alongside Go sources, for constructs the transpiler
subset cannot express but OTP needs (records, macros, complex guards, binary
pattern matching, list comprehensions).

Mechanism (single integration point — buildApp, shared by build and release):
a .erl input bypasses the transpiler, is validated (basename = module name,
guarded by validAppName; -module/filename mismatch rejected via erlModuleName),
copied through, and listed in the generated .app; downstream erlc + .app/
.rel generation is unchanged. Native modules are non-application by scope —
the application and supervisor modules stay Go.

Interop uses existing OTP mechanisms: a native gen_server registered
{global, Name} is reached from transpiled Go via otp.CallGlobal("Name", ...).
No new calling marker (deferred), no transpiler change, no pkg/otp change.

Testing (all green on real OTP 29.0.3): unit tests for buildApp .erl routing
and the -module/filename cross-check; a CLI integration e2e driving real
wm release --self-contained with a mixed Go+native input set, booted under a
scrubbed environment; and ladder rung VIII running a native gen_server (record +
guard) inside a supervised release with a transpiled-Go client. gosec unchanged
in class (5 HIGH, all accepted G703 path-traversal-taint; the one new finding is
the validAppName-guarded .erl copy).

Third-opinion review gate (GitHub Copilot) surfaced three items, all folded in:
a -module/filename cross-check (fail fast rather than defer to erlc), a shared
usage-hint constant (DRY), and a writeModule helper (KISS).

Signed-off-by: Boris Mühmer 328183+bsmr@users.noreply.github.com