3 ms·
I love the fact that they chose s-expressions for the textual representation of WASM[0][1]. [0]: https://developer.mozilla.org/en-US/docs/WebAssembly/Understan
by kuwze 9y ago
I love the fact that they chose s-expressions for the textual representation of WASM[0][1].
[0]: https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format https://developer.mozilla.org/en-US/docs/WebAssembly/Underst...
[1]: https://github.com/WebAssembly/design/blob/master/TextFormat.md https://github.com/WebAssembly/design/blob/master/TextFormat...
- bcherny 9y agoCould you explain for the uninitiated?
- icebraining 9y agoWASM supports two formats; a binary format, which is the recommended for actually shipping to the browser, and a text format, mostly for humans to read and edit programs. The text format uses Lisp-style syntax, with parenthesis, e.g.: (func (param i32) (param i32) (result f64) ... ) This syntax is called S-expressions, and it has strong adherents and opponents.
- kazinator 9y agoNo, only weak, misinformed opponents with low to no experience with S-expressions.
- deleted 9y ago[deleted]
- kodablah 9y agoThere are some shortcuts and other possible ways to represent the same code/items using, as your link mentions, the linear representation and import/export shortcuts. While not the canonical text spec, I find the grammar at https://github.com/WebAssembly/spec/tree/master/interpreter#s-expression-syntax https://github.com/WebAssembly/spec/tree/master/interpreter#... The clearest to understand.