Add wasm2elf: i32 WebAssembly to static x86-64 ELF compiler in MoonBit

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Sonnet 5.5 committed 2026-11-21 00:53:04 -08:00
commit b8617c7aaa
22 files changed
+1219

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Build every examples/*.wat to a native ELF with wasm2elf and run it.
set -u
cd "$(dirname "$0")"
EXE=_build/native/debug/build/cmd/main/main.exe
mkdir -p out
for wat in examples/*.wat; do
n=$(basename "$wat" .wat)
wasm-tools parse "$wat" -o "out/$n.wasm" && wasm-tools validate "out/$n.wasm" || continue
$EXE "out/$n.wasm" "out/$n" >/dev/null || continue
./out/$n; echo "$n -> exit $?"
done