Skip to content

Stack Inspection #1356

Open
Open
@RossTate

Description

@RossTate

My impression was that there was interest in providing stack inspection, but that interest was reserved until having a better understanding of what it would entail. So this discussion is to explore the design space a bit more and understand what considerations need to be taken into account more thoroughly.

From my perspective, the key functionality to add is

  • answer $dispatch_tag instr1* within instr2* end
    • where dispatch tag $dispatch_tag : [ti*] -> [to*]
    • and instr1* : [ti*] -> [to*]
    • which executes (and inherits the type of) instr2*, during which answering any stack search for $dispatch_tag with instr1*

where there is some way to look for these answers in the current stack, such as

  • call_stack $dispatch_tag : [ti*] -> [to*]
    • where dispatch tag $dispatch_tag : [ti*] -> [to*]
    • which looks up the stack for an answer $dispatch_tag and calls it

Applications we should consider here are stack tracing, linear-memory gc-root collection and updating, and two-phase exception handling. This also pertains to continuations and stack switching, but as those are less familiar concepts and unnecessary for these applications, I suggest not using them as examples, at least initially.

@rossberg My sense was that your main concern was that you had some unifying alternative in mind. Would you mind writing it up to inform the discussion?

Edit: Jump to here and the next two comments for a better implementation-focused description of answer prompted from some good questions from @aardappel.

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