Luna is more than a wrapper, it's what a Lua API should be.
There's no more pushing things onto the stack or popping them off; Luna takes care of all that. Lua is fun again:
l := luna.New(luna.AllLibs)
libMembers := []luna.TableKeyValue{
{"doStuff", DoStuff},
{"doThings", DoThings},
{"makeMeASandwitch", MakeMeASandwitch},
}
l.CreateLibrary("lib", libMembers...)
l := luna.New(luna.AllLibs)
l.LoadFile("fun.lua")
l.Call("awesomeFunction", 3, 4)
go get github.com/beatgammit/luna
Luna uses golua, and that looks for a shared object called lua5.1 on Linux.
Examples are found in examples/
:
helloworld
- loads a file and returns a string; nothing fancycall-function
- make calls from Go -> Lualibrary
- define library to make calls from Lua -> Gostdout
- override stdout for calls to print()