What you are describing for Revolt is:
the debugger sees semantic execution objects (
Levels), not the internal continuation mechanics used to make aLevelresumable
That is a good design, and it is similar in spirit to Stackless Python, but not identical in mechanism. In Stackless Python, the visible debugging units are still the usual Python execution events and frames; what becomes special is that tracing/profiling is per tasklet and needs to follow task switches via the scheduler callback. The docs are explicit that to get per-tasklet debugging support, you enable tracing across tasklets using the schedule callback, which “sees every task switch,” and Stackless exposes per-tasklet trace_function / profile_function to support that. (stackless.readthedocs.io)
So the closest mapping is:
- Stackless Python: debugger granularity is still Python frames/events, while scheduler/tasklet switches are additional visible structure. Internal low-level machinery is not itself a debugging unit. (stackless.readthedocs.io)
- Revolt stackless: debugger granularity can be
Levellifetime, while the internal continuation states inside aLevelremain invisible unless you deliberately expose them. That matches where you say you had been assuming a debug “step” happens when a result is synthesized, regardless of how many internal states aLevelgoes through, and that creating aLevelis effectively the API for exposing a step.
So I would say: yes, your instinct mirrors the Stackless Python philosophy more than the exact Stackless Python API.
The key point is that Stackless Python does not try to make every continuation hop or scheduler-internal maneuver directly visible to the debugger. The debugger operates on a higher-level execution model: frames, lines, calls, returns, exceptions, and tasklet switches. Likewise, in Revolt, it is very reasonable for the debugger to operate on Levels and their completion/creation boundaries, not on every continuation label/state inside an executor. (stackless.readthedocs.io)
Your "if you want a debug hook, you must do that with a Level’s lifetime" idea is therefore a strong and coherent rule, and it lines up very well with the design pressure you identified. You wrote that the Stepper_Executor() and Evaluator_Executor() were split specifically to get single-step debugging granularity, and that if Level existence were not the API for exposing a step, then you would need some other hook to say what debugger “buttons” apply to a Level.
That is a very important architectural insight: once you choose Level as debugger-visible execution unit, several things become cleaner:
- step-in / step-over / step-out are defined in terms of
Levelcreation and completion - stack inspection is defined in terms of enumerating
Levels - executor internals can evolve without destabilizing the debugger contract
And that also fits what you said in the PARSE debugger thread: a debugger may be able to maintain a stack-accurate model from events, but building stack tools by patching a shadow stack on every hook is a dead end; stack display should come from enumerating the real stack structure instead.
So I would frame the distinction like this:
Visible to debugger
LevelcreatedLevelcompletedLevelfailed/threw/unwoundLevelsuspended/resumed- source span / executor description / dialect metadata for that
Level
Invisible implementation detail
- the continuation labels/state machine states inside one executor
- pointer rewiring or output-target retargeting
- bounce/trampoline churn that does not create or finish a debugger-visible
Level
That is not only defensible; it is probably the right abstraction boundary.
The one place I would be careful is not to overstate the parallel with Stackless Python. In Stackless Python, you do not generally need to invent a new Python frame lifetime just to expose a new debugger-visible step; the runtime already has an existing frame/event model. In Revolt, because you are designing the execution model more explicitly around Levels and executors, you are making a stronger claim:
debugger granularity is whatever gets reified as a
Level
That is a more explicit and more powerful contract than Stackless Python’s.
It also dovetails with your "cross-trampoline visibility" rule. You note that a nested trampoline started inside an external-API native is effectively invisible to the outer debugger, making such code a black box unless it is written cooperatively in continuation style. That means the debugger boundary is not "all computation," but computation that participates in the shared Level/trampoline protocol.
So my answer would be:
Yes, hiding continuation internals and exposing only Level lifecycle is the right sort of idea, and it is philosophically similar to Stackless Python. But Stackless Python’s visible units are still Python frames/events plus tasklet switches; Revolt’s visible units would more explicitly be Levels.
That is a solid debugger model, especially for dialected debugging, because it lets you say:
- generic debugger operates on
Levels - each
Executorknows how to describe itsLevel - dialects can opt into richer stepping only by reifying meaningful work as debugger-visible
Levels
And that matches your own description that each Level has an Executor, and that the executor is the natural place to reflect what a stack level means to debugging tools.
A compact way to state the rule would be:
In Revolt, continuations implement a
Level; they are not themselves debug frames.
If you want debugger-visible granularity, reify it as aLevel.
That sounds like a very good rule to build around.
I can sketch what step-in / step-over / step-out would look like under that rule, including suspend/resume and throw/unwind.