wasm-chisel
wasm-chisel copied to clipboard
Translator which replaces known imports with snippets
From: https://github.com/ewasm/ewasm-cleanup#libc-methods
Goal is to have a translator which takes a wasm module (called the "helper") and a list of imports. The current module is searched for the list of imports. If found, the import is removed and the function from the helper is copied in.
The first two to start with:
-
memcpy(i32, i32, i32) -> i32
from https://github.com/ewasm/ewasm-cleanup/blob/master/memcpy.wast -
memset(i32, i32, i32)
from https://github.com/ewasm/ewasm-cleanup/blob/master/memset.wast
Fastly has a similar tool: https://github.com/fastly/lucet/tree/master/lucet-builtins/wasmonkey
This tool is now independent: https://github.com/jedisct1/wasmonkey