Skip to content

v0.2.4

Choose a tag to compare

@github-actions github-actions released this 22 Oct 04:02
· 35 commits to main since this release
f1262ee

Implements Synod 0.2. The compiler now also runs in the browser: synod.wasm
checks, formats, runs and draws programs with exactly the same output as the
command line, ready for the website's interactive examples.

Added

  • synod.wasm, the compiler for WebAssembly (GOOS=js GOARCH=wasm, built from cmd/synod-wasm): a global synod with the synchronous functions check, run, format and version. They take the program as a files object and return the CLI's check.json, status, summary, trace and scene as text, byte-identical to the native build; they never throw (errors are {code, message} with exit code 2). std is embedded; other modules come in files under vendor/.
  • Release assets synod-<tag>.wasm (about 8.4 MiB, 2.2 MiB gzipped) and synod-<tag>-wasm_exec.js (from the Go toolchain that built the module), both listed in SHA256SUMS. go run ./internal/release/cmd/wasm -tag <tag> -out dist builds them and fails over the size budget (9.5 MiB, 2.75 MiB gzipped).
  • CI runs the runtest and driver goldens compiled to WebAssembly under Node, diffs the trace and scene hashes against Linux, and compares the JS API running in Node with the native API and the goldens (internal/wasmtest).

Changed

  • The call-depth limit is 500 nested calls on every target (it was 10000), in the simulator and in the scene builder (value.MaxCallDepth): the WebAssembly build overflows the JS stack of plain Node at about 3000 nested calls, and browsers can have smaller stacks. The run-limit message is still more than <limit> nested calls.
  • synod check and synod fmt skip folders named vendor when they walk a folder, like testdata, .x and _x; an explicit file or folder argument is still processed.