logoalt Hacker News

masklinn • today at 4:52 PM • 2 replies • view on HN

It's just sexpr but it's a rough sexpr since it's an exact translation of the bytecode:

    (func $add (export "add") (param $x i32) (param $y i32) (result i32)
      (i32.add (local.get $x) (local.get $y)))
In clojure using native annotations, that would be along the lines of

    (defn add ^int [^int x ^int y]
      (+ x y))

Replies

yawaramin • today at 6:47 PM

WAT was never intended to be a high-level language like Clojure, it's a text representation of WebAssembly.

➕ show 1 reply
SrslyJosh • today at 6:15 PM

[dead]