The WebAssembly frontend for the carder compiler backend.
this is a large experimental project. no promises made. don't use it in production, it's pretty slow right now (that will be fixed in the future)
scribbler decodes a .wasm, validates it and lowers it into carder's IR, and carder does everything from there down to a running BEAM module.
wasm -> carder ir -> core erlang -> beam
scribbler builds with gleam 1.16 on erlang/otp 29.
$ gleam run -- run test/scribbler/conformance/corpus/add.wasm add 3 5
8that turns the module below into a .beam, loads it and calls its add export with 3 and 5:
(module
(func (export "add") (param i32 i32) (result i32)
(i32.add (local.get 0) (local.get 1)))
(func (export "mul") (param i32 i32) (result i32)
(i32.mul (local.get 0) (local.get 1))))arguments and results are raw unsigned bit patterns, so an i32 -1 is written 4294967295. gleam run -- help lists the other commands, which dump each stage of the pipeline on its own.
Apache License 2.0. see NOTICE for attribution.
