Skip to content

Unhandled suspension in embedding API #95

@titzer

Description

@titzer

Some offline discussion turned up the issue of how to represent unhandled suspensions in the embedder API. Let's use this issue to discuss.

AFAICT an unhandled suspension is a pair of (something like) an exnref and a contref. An exnref is itself a pair of a tag and a payload, i.e. a vector of values. Tags in stack-switching add results, but I think they are only relevant for the static typing of handlers in the bytecode.

@rossberg had brought up the concept of a "meta-continuation". My understanding that that is basically a contref that could/should be resumable via the embedding API.

I think contref is pretty similar to a funcref from the embedder's perspective; invoking it is a meta-level operation which is dynamically-typed. The only differences I can see are:

  1. contref doesn't fit under the any heaptype hierarchy, so it should fail any dynamically-typed embedder operations that take an anyref,
  2. contref supports, or should support cont.bind, if we have that embedder operation,
  3. invoking a contref could suspend (but I think invoking a funcref can also suspend), and
  4. it may be represented differently, since it could be a continuation object or a pair of a version+stack resource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions