Wax: A User-Friendly Syntax for WebAssembly
TL;DR:
As it ships in the binary, its body is seven bytes: Parameters count as local variables ( locals ): local.get 0 and local.get 1 read the two arguments, and the leading 00 says the function declares no locals beyond them.
Longer Read:
The runtime of wasm_of_ocaml, the OCaml-to-WebAssembly compiler developed alongside js_of_ocaml, is nearly 27,000 lines of WebAssembly written by hand. Although it grew out of wasm_of_ocaml, Wax is meant for anyone who writes WebAssembly by hand. Each Wax construct maps directly onto Wasm instructions and types.
Related Skills:
WebAssemblyFunctional ProgrammingCompiler Theory
💬 0 comments