That makes sense. I suppose the best starting point for this would be Gallium.jl?
I’d like to get a reality check. My understanding right now is that when an exception is triggered, the stack is unwound, meaning that all kinds of finalizer code is run on the way back down, and the stack pointer points to the base of the stack in the absence of exception handlers. Does Julia make a copy of the stack before unwinding the stack? If not, how can
catch_stracktrace confidently recover the last trace, given that other functions (eg. finalizers) may have been called, and overwritten parts of the stack?
There are obvious candidates in my mind for “C libraries” (PyCall, RMath, …) Are there instances of “pure, non-mathematical Julia code” that get compiled into C-calls with Julia callbacks?