Super basic and a tiny bit hardcoded WAT-like syntax for generating the array of arrays of arrays of arrays wasm implementation in wasm.kp, allowing us to write psudo-WAT in kraken and output binary wasm with 1 function call

This commit is contained in:
Nathan Braswell
2021-07-18 23:42:19 -04:00
parent d3dd37c60e
commit d6d7af0bc1
3 changed files with 63 additions and 20 deletions

View File

@@ -1,11 +1,19 @@
(with_import "./wasm.kp"
(let (
_ (println "args" *ARGV*)
(_ _ in out) (cond (!= (len *ARGV*) 4) (error "wrong number of params")
(_ _ out) (cond (!= (len *ARGV*) 3) (error "wrong number of params")
true *ARGV*)
_ (println "in" in "out" out)
wasm_code [
]
_ (println "out" out)
wasm_code (module
(func (param i32) (result i32)
(i32.const 34)
(local.get 0)
(i32.add)
)
(export "add" (func 0))
)
_ (write_file out (wasm_to_binary wasm_code))
return_code 0
) return_code ))