Embedding WebAssembly in OCaml for Safe Program Construction
WebAssembly (wasm) is a binary instruction format for a stack-based virtual machine originally designed to improve the safety and performance of client-side web applications. It has since gained popularity outside of the browser because of its portability and security guarantees. These features make it an ideal encoding for serialized representations of computation, and a critical format for modern programming languages to interface with. While existing OCaml libraries support standards development, symbolic execution, and compiling OCaml to wasm, they lack explicit facilities for manipulating wasm modules. The ability to construct and rewrite wasm code, as provided in Rust by tools such as wasm-bindgen and wirm, would elevate wasm’s utility in the OCaml ecosystem. Leveraging OCaml’s strong typing and powerful type inference can help to ergonomically make illegal wasm programs unrepresentable.
Inspired by TyXML and Hardcaml, I propose WasML: a library that enforces syntactic and semantic constraints in wasm programs via OCaml types. WasML enables OCaml programmers to build and rewrite wasm programs with a higher assurance of correctness at compile time, laying the foundation for future work on serializable computation and parameterized code generation.
Fri 17 OctDisplayed time zone: Perth change
13:45 - 15:30 | |||
13:45 30mTalk | How the OCaml Community Established Its Code of ConductInvited Talk OCaml Sudha Parimala Tarides | ||
14:15 30mTalk | Embedding WebAssembly in OCaml for Safe Program Construction OCaml Hunter DeMeyer University of Illinois Urbana-Champaign | ||
14:45 30mTalk | smaws: An AWS SDK for OCaml OCaml | ||
