Of course those would have to be side-effect free, or somehow "sandboxed".
It seems like debug printers should be pure functions but you never know what sort of weird stuff people do.
It seems like debug printers should be pure functions but you never know what sort of weird stuff people do.
Lots of devils in the details, but that sounds possible.
The product I work on does pretty much exactly this - we need it because our debugger time travels and we can't allow history to be altered!
I wrote some words here: https://medium.com/time-travel-debugging/calling-functions-i...
But it's basically exactly what you propose. We didn't sandbox the syscalls but you could do that too.