Skip to content
/ luar Public
forked from stevedonovan/luar

luar is a Go package for conveniently working with the luago Lua bindings. Arbitrary Go functions can be registered

License

Notifications You must be signed in to change notification settings

vxcontrol/luar

Repository files navigation

Luar: Lua reflection bindings for Go

Luar is designed to make using Lua from Go more convenient. Go structs, slices and maps can be automatically converted to Lua tables and vice-versa. The resulting conversion can either be a copy or a proxy. In the latter case, any change made to the result will reflect on the source.

Any Go function can be made available to Lua scripts, without having to write C-style wrappers.

Luar support cyclic structures (map[string]interface{}, lists, etc.).

User-defined types can be made available to Lua as well: their exported methods can be called and usual operations such as indexing or arithmetic can be performed.

See the documentation for usage instructions and examples.

Installation

Install with

go get <repo>/luar

Luar uses Alessandro Arzilli's golua. See golua's homepage for further installation details.

REPL

An example REPL is available in the cmd folder.

Issues

The GoToLua and LuaToGo functions take a reflect.Type parameter, which is bad design. Sadly changing this would break backward compatibility.

About

luar is a Go package for conveniently working with the luago Lua bindings. Arbitrary Go functions can be registered

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%