Skip to content

Commit

Permalink
Update comparison of the 2 proposals. (WebAssembly#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
dschuff authored and aheejin committed Oct 26, 2018
1 parent ca408dc commit 51411c7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions proposals/Exceptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -736,18 +736,24 @@ the event indices (Used for both imports and module-defined).

## Comparisons of the two proposals

- Proposal 2 is more expressive and possibly provides more flexibility
for future frontend developers for other languages.

- As Proposal 2 introduces first-class exception reference type, we have to
manage lifetime of exception objects, from which arises several questions.
- Proposal 2 introduces a first-class exception reference type. This raises several
questions about exception lifetime management:
- How do we manage exception objects' lifetime in non-GC embeddings? Do we
make reference counting mandatory?
- Who is responsible for deleting exception objects?
- What should we do for except_ref values of invalid exception objects already
deleted?
- How should exception reference type be related to the existing reference
type or GC proposal?

Consequently, Proposal 1 would be simpler to implement for VMs which do not need
reference types or related functionality such as GC objects.

- The first-class exception type makes Proposal 2 more expressive, possibly providing
more flexibility for frontend developers for non-C langauges. In particular, allowing
exception objects to escape catch blocks may simplify control flow translation.
Conversely, it is slightly more complex for languages which do not have convenient ways to model
reference types.

- In Proposal 2, the unwinder must stop at every call stack frame with `catch`
instruction because the tag matching happens within a `catch` block, whereas
Expand Down

0 comments on commit 51411c7

Please sign in to comment.