Skip to content
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

Replace 'event' with 'tag' in explainer #161

Merged
merged 5 commits into from
Jun 18, 2021

Conversation

aheejin
Copy link
Member

@aheejin aheejin commented Jun 11, 2021

It was suggested to change the term 'event' to 'tag' to reference the
section name and the entries within the section. The suggested reasons
were they can be used something other than events in future, and the
term event can be confusing with other concepts on the web.

Closes #159.

It was suggested to change the term 'event' to 'tag' to reference the
section name and the entries within the section. The suggested reasons
were they can be used something other than events in future, and the
term event can be confusing with other concepts on the web.

Closes WebAssembly#159.
Comment on lines 55 to 56
In general, an event handler allows one to process an event generated by a block
of code. Events suspend the current execution and look for a corresponding event
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"event" should be replaced with "exception" wherever it is referring to a runtime exception, "exception tag" whenever it is referring to the static exception type, and just "tag" whenever it is referring to potential future contents of the tag section.

Similarly, it would be good to replace instances of "exception" with "exception tag" when they are referring to the static exception declaration.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion; I think the distinction makes the text a lot clearer. Fixed many parts of the existing text.

Comment on lines 428 to 429
A new `tag` section is introduced. If included, it must appear immediately after
the memory section.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth adding the caveat that custom sections can appear in between these two sections. Alternatively, we could say that the tag section is ordered between the memory section and the global section.

Edit: actually, we already say that below, so maybe this sentence isn't necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks; removed.

| count | `varuint32` | count of the number of event to follow |
| type | `event_type*` | The definitions of the event types |
| count | `varuint32` | count of the number of tags to follow |
| type | `tag_type*` | The definitions of the tag types |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is tag_type defined anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While creating this PR, I found multiple occurrences that we had missed when we had replaced 'exception' with 'event' before, and I tried to replace 'event' with 'tag' in this PR, so I missed those remaining 'exception's.. It was written as exception_type. I changed it to tag_type now.

aheejin and others added 2 commits June 15, 2021 00:20
Co-authored-by: Thomas Lively <7121787+tlively@users.noreply.github.com>
Copy link
Member

@rossberg rossberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, mostly nits.


| Field | Type | Description |
|-------|------|-------------|
| `attribute` | `varuint32` | The attribute of an exception. |
| `attribute` | `varuint32` | The attribute of a tag. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously a separate issue, but I'm just noticing this while I'm here: I'd conservatively make this a uint8 for the time being, since we do not know yet how exactly this is gonna be used in the future, and a zero uint8 is still forward compatible with varuint32. That's what we did in other places anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that as a followup PR. But why uint8 better than varuint32 here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's both more conservative and faster to decode. No reason to bother with allowing multibyte representations of 0 before we even know that we'll need them.

aheejin and others added 2 commits June 15, 2021 13:45
Co-authored-by: Andreas Rossberg <rossberg@mpi-sws.org>
aheejin added a commit to aheejin/binaryen that referenced this pull request Jun 17, 2021
We recently decided to change 'event' to 'tag', and to 'event section'
to 'tag section', out of the rationale that the section contains a
generalized tag that references a type, which may be used for something
other than exceptions, and the name 'event' can be confusing in the web
context.

See
- WebAssembly/exception-handling#159 (comment)
- WebAssembly/exception-handling#161
@aheejin aheejin merged commit 5aa690d into WebAssembly:master Jun 18, 2021
@aheejin aheejin deleted the tag_section branch June 18, 2021 02:59
aheejin added a commit to llvm/llvm-project that referenced this pull request Jun 18, 2021
We recently decided to change 'event' to 'tag', and 'event section' to
'tag section', out of the rationale that the section contains a
generalized tag that references a type, which may be used for something
other than exceptions, and the name 'event' can be confusing in the web
context.

See
- WebAssembly/exception-handling#159 (comment)
- WebAssembly/exception-handling#161

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D104423
aheejin added a commit to aheejin/exception-handling that referenced this pull request Jun 18, 2021
This changes the encoding of the `attribute` field, which is preserved
for future use, from `varuint32` to `uint8`. `uint8` is simpler to
encode/decode and this attribute is not likely to need `varuint32` range
even in future.

Suggested in
WebAssembly#161 (comment).
aheejin added a commit to WebAssembly/binaryen that referenced this pull request Jun 18, 2021
We recently decided to change 'event' to 'tag', and to 'event section'
to 'tag section', out of the rationale that the section contains a
generalized tag that references a type, which may be used for something
other than exceptions, and the name 'event' can be confusing in the web
context.

See
- WebAssembly/exception-handling#159 (comment)
- WebAssembly/exception-handling#161
aheejin added a commit to aheejin/wabt that referenced this pull request Jun 22, 2021
We recently decided to change 'event' to 'tag', and  'event section' to
'tag section', out of the rationale that the section contains a
generalized tag that references a type, which may be used for something
other than exceptions, and the name 'event' can be confusing in the web
context.

See
- WebAssembly/exception-handling#159 (comment)
- WebAssembly/exception-handling#161
aheejin added a commit to aheejin/wabt that referenced this pull request Jun 22, 2021
We recently decided to change 'event' to 'tag', and  'event section' to
'tag section', out of the rationale that the section contains a
generalized tag that references a type, which may be used for something
other than exceptions, and the name 'event' can be confusing in the web
context.

See
- WebAssembly/exception-handling#159 (comment)
- WebAssembly/exception-handling#161
aheejin added a commit that referenced this pull request Jun 22, 2021
This changes the encoding of the `attribute` field, which is preserved
for future use, from `varuint32` to `uint8`. `uint8` is simpler to
encode/decode and this attribute is not likely to need `varuint32` range
even in future.

Suggested in
#161 (comment).
kripken pushed a commit to WebAssembly/wabt that referenced this pull request Jun 22, 2021
We recently decided to change 'event' to 'tag', and  'event section' to
'tag section', out of the rationale that the section contains a
generalized tag that references a type, which may be used for something
other than exceptions, and the name 'event' can be confusing in the web
context.

See
- WebAssembly/exception-handling#159 (comment)
- WebAssembly/exception-handling#161
@aheejin aheejin mentioned this pull request Jun 22, 2021
takikawa added a commit to takikawa/wasm-tools that referenced this pull request Jun 22, 2021
The exception handling proposal spec was recently changed to rename the
event section to the tag section, in order to use a clearer name that
conflicts with fewer things in the web context:

  WebAssembly/exception-handling#161
takikawa added a commit to takikawa/wasm-tools that referenced this pull request Jun 22, 2021
The exception handling proposal spec was recently changed to rename the
event section to the tag section, in order to use a clearer name that
conflicts with fewer things in the web context:

  WebAssembly/exception-handling#161
alexcrichton pushed a commit to bytecodealliance/wasm-tools that referenced this pull request Jun 23, 2021
#291)

* Update wabt test submodule to latest

* Update wasm-encoder linking tests for latest wabt

A recent PR to wabt changed the printing slightly for these test cases:

  WebAssembly/wabt#1669

* Rename "events" to "tags" for exception handling

The exception handling proposal spec was recently changed to rename the
event section to the tag section, in order to use a clearer name that
conflicts with fewer things in the web context:

  WebAssembly/exception-handling#161
ioannad added a commit to ioannad/exception-handling that referenced this pull request Jun 25, 2021
ioannad added a commit to ioannad/exception-handling that referenced this pull request Jun 25, 2021
Horcrux7 added a commit to i-net-software/JWebAssembly that referenced this pull request Aug 29, 2021
arichardson pushed a commit to arichardson/llvm-project that referenced this pull request Sep 13, 2021
We recently decided to change 'event' to 'tag', and 'event section' to
'tag section', out of the rationale that the section contains a
generalized tag that references a type, which may be used for something
other than exceptions, and the name 'event' can be confusing in the web
context.

See
- WebAssembly/exception-handling#159 (comment)
- WebAssembly/exception-handling#161

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D104423
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.

Event vs. exception?
4 participants