-
Notifications
You must be signed in to change notification settings - Fork 1
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
Text format for shorthand shared
functions
#81
Comments
Syntactially, the type use in the function includes the explicit
If we want to allow
It would be an error if On the other hand, the fact that type uses can define new types is one of the most complex and unfortunate parts of the text format, and there is no precedent for letting them define new non-MVP function types such as non-closed function types or types in nontrivial rec groups. I would be happy to avoid extending this feature of the text format. |
As the "other" linked above I can chime in here to say that I'd be fine with the suggestion to explicitly not add this sugar to the text format. I don't have a horse in the race either way and mostly figured it'd be good to have a decision on the record one way or another, but either way is fine by me. If we go the text route I'd put a vote in favor of |
I think we should allow/require shared. If not, it means that in a shared memory setting, you'll have to define and reference all function types manually and repeat yourself all the time. By the same token we considered that too tedious for unshared functions, we would likely consider that too tedious for shared ones. It's also arguably a bit inconsistent to derive some parts of a function's type from the type definition but not other parts.
Since instructions can be parenthesised as well, I don't see how the extra brackets buy anything in that regard. I find wrapping them around the params/results somewhat odd in this instance – to me that would suggest that it applies to the parameters, not the function as a whole. |
The current text format only allows specifying a
shared
function with an explicit type index:I had thought (and so have others) that it might be nice to have a short-hand form for writing
shared
functions when printing WAT. There are some advantages to this: easier to read WAT, easier to write WAT manually, consistency with unshared functions, etc. But, for now, we have left this out because it's unclear how to best express this:(shared (func ...))
?(func (shared (param) (result)) ...)
?I'm opening this issue to track this for discussion and for future users who are interested in why things are the way they are.
The text was updated successfully, but these errors were encountered: