A pure Go implementation of the Lua 5.2 virtual machine for scripting Go applications.
go-lua is a pure Go implementation of the Lua 5.2 virtual machine that allows developers to embed Lua scripting capabilities into their Go applications. It solves the problem of adding dynamic scripting functionality to Go programs without requiring external C dependencies or separate Lua installations.
Go developers who need to add scripting capabilities to their applications, particularly those building tools, game engines, or systems requiring user-defined logic or configuration.
Developers choose go-lua because it provides a production-tested, dependency-free way to integrate Lua scripting into Go projects, with the reliability of being used at scale by Shopify since 2014.
A Lua VM in Go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Eliminates C dependencies, making integration straightforward for Go projects without external Lua installations, as emphasized in the README.
Used in Shopify's production tooling since 2014, including load generation systems, demonstrating long-term reliability in real-world scenarios.
Passes all Lua source files from the Lua test suite and over a third of test cases, ensuring correct bytecode execution and VM behavior.
Implements most core Lua libraries out of the box, providing essential scripting functionality for common use cases in Go applications.
Benchmarks show it's 6x slower than C Lua in recursive tests and slower than alternatives like gopher-lua, due to debug hooks and heap-allocated stack frames as admitted in the README.
Missing key Lua 5.2 features like regular expressions, coroutines, string.dump, and weak reference tables, which are explicitly stated as not supported.
Requires checking out the lua-tests submodule for full testing, adding an extra step compared to simpler Go packages with self-contained test suites.