Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is partially true, but the standard text format also allows the instructions to be nested as S-expressions, for example:

  (i32.add
    (i32.const 0)
    (i32.const 1))
Many projects, including the official spec test suite and the Binaryen test suite, primarily use this format.

> IIRC early pre-release-versions of WASM were entirely built from S-expressions and as a 'pure stack machine' (I may remember wrong though).

Yes, the S-expressions predate WebAssembly even being a stack machine. Originally the design was that it encoded an AST, so the folded S-expression format was the only option.

There was a lot of discussion back in the day (before my time) about creating a better text format, but no one could agree on what it should be, so they just defaulted to the S-expression idea and focused on getting WebAssembly out the door.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: