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

+8
View File
@@ -0,0 +1,8 @@
;; recursive factorial(5) = 120, plus if/else with result
(module
(func $fact (param $n i32) (result i32)
(if (result i32) (i32.le_s (local.get $n) (i32.const 1))
(then (i32.const 1))
(else (i32.mul (local.get $n) (call $fact (i32.sub (local.get $n) (i32.const 1)))))))
(func (export "main") (result i32)
(call $fact (i32.const 5))))