ZK WASM Hacking notes
Links
Investigations
Refactoring/Features
Example module
WASM Module
Corresponding Cranelift IR
Cranelift ZK ASM output
WASM transpiler ZK ASM output
Authoring backend
https://github.com/bytecodealliance/wasmtime/issues/4126
- Implement
ZK::isa_builder
- Implement
ZKBackend
and wrap it
- Implement
compile::compile<ZKBackend>
- Implement
create_reg_env
This is relatively simple.
- Implement
MachInstEmit
Also looks relatively simple
- Implement
AArch64MachineDeps
This looks like ABI that ISA provides, so a translation for some common ops
10-20 methods, all nicely documented, so shouldn't be a big problem
- Implement
Inst
pretty-printer
- Find an interpreter
- Compile it to WASM/Cranelift
- Produce small/efficient ZK ASM out of it
Done