;; sum-i64.wat -- the smallest honest test module for the SEVEN KG WebAssembly ;; surface, and the source of sum-i64.wasm beside it. ;; ;; WHY IT IS HAND WRITTEN AND NOT COMPILED. Our node admits a module with NO ;; imports granted: no filesystem, no network, no environment, no host clock, ;; no host randomness. A Go binary built with GOOS=wasip1 imports clock_time_get, ;; random_get, fd_write and proc_exit, so it is refused before the engine sees ;; it. The same is true of anything built against a standard library. A module ;; that runs on the sealed surface has to import nothing, and the clearest way ;; to show what that means is a module that is nothing but arithmetic. ;; ;; It takes two 64 bit integers and returns their sum. That is the whole of it. (module (func (export "sum") (param i64 i64) (result i64) local.get 0 local.get 1 i64.add))