4 ms·
Author here. It's something inbetween. Pretty much the way it works is it dynamically inserts references to all objects/packages/functions in scope at compile
by d4l3k 9y ago
Author here.
It's something inbetween. Pretty much the way it works is it dynamically inserts references to all objects/packages/functions in scope at compile time. It then has an in Go interpreter that uses reflection to be able to interact with those references in a transparent way.
The compiled part is just go so that part interacts the same way. The Go interpreter is only partially complete so there may be a few things that don't work as expected, but should be easy enough to add.
I'm also thinking about adding go1.8 plugin support so you can import new packages during the run instead of specifying them on the command line.
- wybiral 9y agoOh wow. You're interpreting right from go/ast? Very cool!
- d4l3k 9y agoYup!
- cosmos72 9y agoHello d4l3k, I did not try go-pry yet, but I am very curious to compare it with my own attempt at an interactive Go REPL https://github.com/cosmos72/gomacro https://github.com/cosmos72/gomacro They look similar in several aspects, and different in some key ones. For example, mine does not try to instrument compiled code and, among other things, uses exactly go1.8 plugin to import compiled packages at runtime.