Wax: A User-Friendly Syntax for WebAssembly

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.
Read the full story at Tarides →
Related Skills: WebAssemblyFunctional ProgrammingCompiler Theory
Wider Reading: MDN WebAssembly — WebAssemblyExercism — Functional ProgrammingNand2Tetris — Compiler Theory

💬 0 comments

No comments yet — be the first to say what you think.