Repository navigation
v0.2.4
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 fromcmd/synod-wasm): a globalsynodwith the synchronous functionscheck,run,formatandversion. They take the program as afilesobject 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 infilesundervendor/.- Release assets
synod-<tag>.wasm(about 8.4 MiB, 2.2 MiB gzipped) andsynod-<tag>-wasm_exec.js(from the Go toolchain that built the module), both listed inSHA256SUMS.go run ./internal/release/cmd/wasm -tag <tag> -out distbuilds 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. Therun-limitmessage is stillmore than <limit> nested calls. synod checkandsynod fmtskip folders namedvendorwhen they walk a folder, liketestdata,.xand_x; an explicit file or folder argument is still processed.