-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confused about text format #1042
Comments
Yes, there was a change in naming scheme from |
Thank you for that. And for another quick question about text format again. When writing wat code am I supposed to use the S expression style like (i32.add or the stack-based postfix style : Thanks! |
You use the style you prefer. ;) |
Ah nice! |
No, there are different formats for those too: ;; "flat" format
block
nop
i32.const 1
i32.const 2
i32.add
drop
end
;; sexpr format
(block
(nop)
(drop
(i32.add (i32.const 1) (i32.const 2)))
) Same with ;; flat format
i32.const 1 ;; condition
if
nop
else
nop
end
;; sexpr format
(if
(i32.const 1) ;; condition
(nop)
(nop)
)
;; alternate sexpr format
(if
(i32.const 1)
(then (nop))
(else (nop))
) These all produce identical binary output. |
Actually, we dropped this short form on the way to standardisation. |
Interesting, I must have missed that change. :) |
@binji Thanks a lot. That was very helpful. Reading the WASM Standard it isn't obvious that you can use so many different style writing WAT code. |
This has been answered. |
I started writing some wasm code (well actually WAT code) and I'm confused as to what the correct syntax is like I'm seeing wat sample using get_local although the WASM 1.0 spec says local.get. Same for set_local. I have noticed other discrepancies too here and thare
Is it that the WAT samples I'm looking at are outdated or is it that the various WAT -> WASM compilers available right now are not yet compliant with the WASM 1.0 specification ?
Side question: is there a forum for SW development in WASM somewhere ?
Thank you everyone ! (and congrats for making WASM. It's a great initiative)
The text was updated successfully, but these errors were encountered: