Stream: general

Topic: what does "block type" mean?


view this post on Zulip Huỳnh Trần Khanh (Jun 15 2021 at 08:16):

it seems that the instructions inside the block can't pop anything off the stack (aside from the items that they previously pushed) right? then why is the block type still t1* -> t2*? that implies that there is a mechanism for a block to pop items from outside the stack right? if that is true, how could I express that in WAT?

view this post on Zulip Huỳnh Trần Khanh (Jun 15 2021 at 08:16):

apologies in advance, I'm new here.

view this post on Zulip Huỳnh Trần Khanh (Jun 15 2021 at 08:16):

and new to webassembly in general

view this post on Zulip Huỳnh Trần Khanh (Jun 15 2021 at 08:20):

oops this chat room is dead, maybe I should look for an answer on my own, sorry

view this post on Zulip Huỳnh Trần Khanh (Jun 15 2021 at 11:02):

oops I mean outside the block not outside the stack, message editing is disabled for some reason

view this post on Zulip fitzgen (he/him) (Jun 15 2021 at 15:16):

the block can pop any values in the t1* or that it pushes itself, but it can't pop any off from before the t1*

view this post on Zulip Huỳnh Trần Khanh (Jun 16 2021 at 01:43):

this is somewhat... unclear. this implies that t1* can be nonempty, but can you post an example where t1* is nonempty? because I don't think a block can pop anything from outside the block

view this post on Zulip Huỳnh Trần Khanh (Jun 16 2021 at 01:55):

also... I can understand the reduction rules but the typing rules are really confusing to me. do you have any resources to help me understand WASM typing better? by typing I mean the validation aspect of the spec

view this post on Zulip Huỳnh Trần Khanh (Jun 16 2021 at 09:16):

ah answered my own question. a block can take parameters. wow.

view this post on Zulip Huỳnh Trần Khanh (Jun 16 2021 at 09:16):

https://github.com/WebAssembly/spec/blob/master/test/core/block.wast#L277

WebAssembly specification, reference interpreter, and test suite. - WebAssembly/spec

view this post on Zulip bjorn3 (Jun 16 2021 at 14:07):

I think this was introduced by the multi-value wasm proposal: https://github.com/WebAssembly/spec/commit/484180ba3d9d7638ba1cb400b699ffede796927c#diff-cfc42e9323c5feaffe9643627c8a9853faa19bf583ceb07e30580e0896055d20R169

See the multi-value proposal here: https://github.com/WebAssembly/multi-value This PR is built on top of the following PRs: * #1143 (merge nontrapping-float-to-int) * #1144 (merge sign-ex...

Last updated: Nov 22 2024 at 16:03 UTC