Hacker News new | ask | show | jobs
by itishappy 637 days ago
As I understand, that's pretty much exactly how WASM works. It can output either a `.wasm` binary or the same code in a `.wat` text format that looks like this:

    (func (param i64) (result i64)
      local.get 0
      i64.eqz
      if (result i64)
        i64.const 1
    else
      local.get 0
      local.get 0
      i64.const 1
      i64.sub
      call 0
      i64.mul
    end)
https://en.wikipedia.org/wiki/WebAssembly#Code_representatio...
1 comments

Thanks, I had no idea this was how it transpiled.