I'm working on providing a way to customize Safepoint with additional enter and exit implementations. The mechanism will be used for preemption in fibers but it can be easily extended to provide other features like profiling and debugging. This PR propagates the current value of the computation alongside its frame to Safepoint.enter as preparation. This will allow a custom enter to also inspect the current value. The main use case would be a Debug effect that also presents values that appear during execution.
Edit: I've pushed a commit with the new interceptor mechanism. Safepoint.immediate will be used by fibers to preempt execution in evaluation loop (suspension is managed by the fiber itself) and Safepoint.propagating provides similar functionality but ensuring propagation across suspensions.
I'm working on providing a way to customize
Safepoint
with additionalenter
andexit
implementations. The mechanism will be used for preemption in fibers but it can be easily extended to provide other features like profiling and debugging. This PR propagates the current value of the computation alongside its frame toSafepoint.enter
as preparation. This will allow a customenter
to also inspect the current value. The main use case would be aDebug
effect that also presents values that appear during execution.Edit: I've pushed a commit with the new interceptor mechanism.
Safepoint.immediate
will be used by fibers to preempt execution in evaluation loop (suspension is managed by the fiber itself) andSafepoint.propagating
provides similar functionality but ensuring propagation across suspensions.