Any plan to add settrace() functionality to VM?
shiyuge opened this issue · comments
shiyuge commented
Normally interpreted languages provide a mechanism for users to register a function that will be called at specific events as program runs, such as function calls and returns. For example, Python provides sys.settrace() and Lua provides debug.sethook().
These hooks are really one of the best features of an interpreted language: you get the chance to inspect the internal state of the VM in your script. These hooks can then be further utilized to build other high level interesting things, such as debugger, inspector, or to collect code coverage.
I would like to contribute such a functionality.