Closed jordemort closed 1 year ago
Neat. Does this afford any performance benefit? Or is it one of those things that's just less stuff for this code to handle once delegated to cgo?
I'm not sure if it would have any performance benefit, but after finding that library I realized I had essentially recreated it by hand because I didn't know about it. It feels a lot cleaner to use it to me, because there are no longer any global variables in on the Go side; at least, there aren't any more in this code that you can see :)
Instead of keeping interpreter state in a homemade global map, use a library that is specifically designed for passing Go pointers back and forth to C.