+
Skip to content

Conversation

ShinWonho
Copy link

@ShinWonho ShinWonho commented Oct 30, 2023

Hello,
I am currently working on converting the DSL you wrote in wasm3 into AL to demonstrate the generality of the SpecTec approach. Fortunately, most of them seem to be converted well with just a few minor adjustments. However, one part that isn't converted properly is the allocmodule, as there is no allocation for the type of module instance. Fortunately, just defining the signature of the alloctypes function was enough to successfully complete the conversion of allocmodule. Now, I'm trying to define the body of the alloctypes function. But there is a typo in the gc proposal, making it hard to comprehend, and it is defined differently in function reference proposal. So, I'm having difficulty understanding how alloctype* should be defined. Could you please provide some guidance on the definition?

Screenshot 2023-10-30 at 2 51 18 PM
  • allocating type in gc proposal
Screenshot 2023-10-30 at 2 57 36 PM
  • allocating type in function reference proposal

(Perhaps 'alloctypes' is not a critical component for execution. If that's the case, please kindly inform me, and we can postpone its body.)

@rossberg
Copy link
Collaborator

rossberg commented Oct 30, 2023

Oops, indeed the DSL spec is missing the alloctypes function.

The GC proposal adds recursive types, so the definition becomes quite a bit more complicated than it still is in the function refs proposal: it has to first "roll up" the types, which substitutes the type indices internal to the recursion, and then it has to do a regular substitution for the others, which all must be defined before the recursion we currently looking at (hence the [0:x_i] on the right).

I don't think there is a typo in the spec (other than the wrong bracket), but it is a bit hard to read in the way it's trying to avoid a recursion. Please see #40 for a more readable formulation.

@ShinWonho
Copy link
Author

Thank you for the quick answer! Now, I get it.

@ShinWonho ShinWonho closed this Oct 30, 2023
@f52985 f52985 deleted the wasm3-module branch October 30, 2023 08:24
Alan-Liang pushed a commit to Alan-Liang/spectec that referenced this pull request Sep 1, 2024
* Resume table syntax

This patch changes the syntax of resume tables:

```wast
(resume $ct (tag $t $h)) => (resume $ct (on $t $h))
(resume_throw $ct $e (tag $t $h)) => (resume_throw $ct $e (on $t $h))
```

* Update examples

* Update overview document

* Update explainer document
rossberg pushed a commit that referenced this pull request Nov 7, 2024
Similar to WebAssembly.Memory (#39), the WebAssembly.Table constructor
also needs an `index` argument.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载