On a similar note, there's a clojure-like (syntax) embeddable VM called glisp: https://github.com/zhemao/glisp. I've been tinkering with it to add dynamic plugins to some golang programs.
I'd be interested if someone were to benchmark it against GopherLua.
Interesting that it implements Lua 5.1 rather than any of the newer versions. Is it because LuaJIT implements 5.1, thereby making that the de facto canonical language version?
Lua 5.1 is the most widely used. LuaJIT is a big factor. But changing existing code to use the 5.2 API is not worth the few changes 5.2 offered. The 5.1 API has the most libraries. Many existing code bases try to stay compatible with 5.1.
This situation may change as 5.3 adds many nice changes.
It's interesting because the Go source appears to be annotating certain patterns with comments where the C version uses a macro. Compare the C version:
case OP_LOADK: {
setobj2s(L, ra, KBx(i));
With the Go version:
case OP_LOADK:
Bx = int(inst & 0x3ffff) //GETBX
reg.Set(RA, cf.Fn.Proto.Constants[Bx])
This in itself isn't a bad thing. When I'm porting code, I try to start with a proven code-base and port from there, while iterating the code to make it more idiomatic (e.g. "case OP_LOADK" is not idiomatic Go).
The problem is, if the author has based their code on this library, they seem not to have credited it (At least, I couldn't find it on my cursory look at the file headers).
The excitement is because Lua is a very nice little language with the explicit goal of being embedded into programs, so when a pure-go port of the language appears that is not just bindings to the C version it is warmly welcomed.
And no, it shouldn't be any faster than luajit (what can really :)
I've noticed that Go seems to be fairly popular for emulators / simple VMs as well. I'm currently working on a SID emulator in Go, and I'm finding it quite fun! (unfortunately, it means that I then need to write a proof of concept synth-like API to the SID, then a proof of concept sequencer to control the synth...)
I'd be interested if someone were to benchmark it against GopherLua.