Interesting read thanks for pointing that out, a strange mashing of lisp
syntax with forth semantics, like
(func $add (param $lhs i32) (param $rhs i32) (result i32)
get_local $lhs
get_local $rhs
i32.add)
(get_local x) pushes one value onto the stack, and (i32.add) pops two and
pushes one. In forth this would be something like:
: add ( x y -- z) i32.add ;
everything between the parens is a stack effect comment, there are no
explicit parameters (they get passed to add on the stack) or anything like
get_local, but the idea is the same, the work of the function pops two
stack items and pushes one.
-Michel
On Fri, Jul 20, 2018 at 9:42 AM, Jean-Christophe Helary <
[email protected]> wrote:
> I was reading this article and found an eery similitude between
> WebAssembly text representation and Lisp. After looking a little further it
> appears that WebAssemble uses S-expressions.
>
> https://blog.scottlogic.com/2018/04/26/webassembly-by-hand.html
>
> https://developer.mozilla.org/en-US/docs/WebAssembly/
> Understanding_the_text_format
>
> Pretty cool :)
>
>
> Jean-Christophe Helary
> -----------------------------------------------
> http://mac4translators.blogspot.com @brandelune
>
>
>
> --
> UNSUBSCRIBE: mailto:[email protected]?subjectUnsubscribe
>