-
Notifications
You must be signed in to change notification settings - Fork 473
[spec review] 3 - Validation #727
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
Comments
I made a fairly-fine-grained pass through Section 3. Overall, this section feels like it's in pretty good shape.
|
@lukewagner, thanks for the review, see #752 for changes.
That's a good suggestion, but unfortunately I have a hard time figuring out how that could be done properly in either Sphinx or Bikeshed. I'll take another look, but can't promise anything.
Reworded.
Removed.
Done.
Yeah, I'm not particularly happy with that. The "C,entry" notation for extending contexts is ubiquitous, though. But usually you don't define contexts as mere arrays, which is what makes it a bit weird here. An alternative I have considered is having the above mean append to the end and then defining extra syntax for indexing the context, which would be reversed for labels. However, I suspect that would be even more confusing. The only other option I can think of is writing it "entry,C" but that would really be unusual and probably confusing to many readers as well.
Done.
Done.
I have changed C.return to be resulttype | NORETURN for now. However, that is a bit irregular in that empty equates "not usable" everywhere else, plus it breaks the convention that empty components can be left out, which now needs special-casing. I didn't understand the second part of your comment. [] is the correct spelling of the empty resulttype, what was implying valtype* in the wording? In any case, that part of the note is obsolete with the other change, so I just removed it.
Fixed.
Added here and likewise for imports.
Cleaned up naming of these and others, plus a few other tweaks. |
Yeah, I also thought about suggesting this. Given how pretty much everything else works in a stacky manner by appending, it seems like all you need to make this look nice is find a stylized bracket that means "index from the end" and use that. That actually seems more natural all around.
Thinking about this a bit more: is |
Additionally:
|
To avoid introducing one-off notation, I tried the other suggestion and reversed the context extension notation to entry,C with some respective note. On second look it doesn't seem too bad, and there aren't many occurrences of it anyway. While applying the change I noticed another problem with NORETURN breaking conventions for empty context fields. Due to that and because it generally seems like a bad fit, I backed out of that earlier change. Instead I added more explicit notes and tried to tweak wording and notation to make it as clear as possible. I think it is okay now, given that it only occurs in a single place, but PTAL.
The latter is pretty much what I had initially -- until @conradwatt discovered during his mechanisation effort that it breaks Preservation. :( The reason is rather technical: roughly, the rules have no way of detecting what "outermost" is, because there is no syntactic marker, and it all has to be compositional to work properly. All well-typed instruction sequences can form larger ones, so it would effectively allow typing any return to a random inner scope. Hail to mechanisation, because this was a somewhat subtle issue. A separate predicate also wouldn't play well with a preservation proof, for related reasons. The only clean solution is to track any such constraint as contextual information.
Good idea, done.
Done. And because it would be weird otherwise I also changed the term from "constant expression" to "static expression". |
@titzer's latest comment raises a valid objection. Hence I reverted this last bit -- it needs more discussion than is appropriate for a mere editorial change. |
It sounds like all issues have been addressed here. The one exception is the discussion about lifting the constraint that globals be immutable in a constant expression. Since we haven't discussed this since then, I assume we're OK lifting this restriction later (if at all). Closing. |
Detail oriented review of draft text:
http://webassembly.github.io/spec/core/bikeshed/index.html#validation%E2%91%A1
Try to be ready to discuss issues by the next in person WG meeting.
The text was updated successfully, but these errors were encountered: