News for hackers. Stuff that matters.
Re:GopherLua: VM and Compiler for Lua in Go by haberman on Saturday February 21, 2015 @01:07PM (#9086257)
From a quick glance at the source, it looks like this may be a port of the existing Lua VM for C into Go.

For example, it appears to use the same opcodes and the main VM loop looks very similar:

http://www.lua.org/source/5.1/lvm.c.html

https://github.com/yuin/gopher-lua/blob/master/vm.go

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])
Re:GopherLua: VM and Compiler for Lua in Go by SixSigma on Sunday February 22, 2015 @03:58AM (#9088773)
And what a useless comment GETBX is.
Re:GopherLua: VM and Compiler for Lua in Go by Intermernet on Sunday February 22, 2015 @04:02AM (#9088782)
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).