Shopify/go-lua

A Lua VM in Go

View on GitHub ↗Jump to charts ↓

Data as of . Signed-in members get hourly updates — create a free account.

Summary Information

Updated 2 hours ago
Added to GitGenius on September 24th, 2026
Created on December 20th, 2013
Open Issues & Pull Requests: 49 (+0)
GitHub issues: Enabled
Number of forks: 213
Total Stargazers: 3,458 (+0)
Total Subscribers: 484 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 260.6 days
Mean response time: 1056.7 days
90th percentile: 2909.3 days
Tracked items: 3

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 3
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,933 days
Stale 30+ days: 3
Stale 90+ days: 3

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

Sign in to see which issues are moving.
Sign in

Detailed Description

go-lua is a Lua VM in pure Go that ports the Lua 5.2 virtual machine to Go and maintains compatibility with binary files produced by the standard Lua compiler.

The project solves the problem of embedding scripting capabilities into Go applications without requiring C bindings or external Lua installations. It achieves this by implementing a complete port of the Lua 5.2 VM in pure Go, including both the compiler and bytecode interpreter. The implementation uses Go's heap for Lua objects and includes debug hooks throughout the execution engine.

Developers should choose this tool when they need to embed Lua scripting directly into Go applications without external dependencies. It suits projects that require simple scripting of Go behavior, as demonstrated by its production use in Shopify's load generation and resiliency tooling. The README compares performance against the C reference implementation and Gopher-lua, noting that go-lua runs recursive Fibonacci roughly six times slower than C Lua and about twenty percent slower than Gopher-lua, with the gap widening in bytecode-heavy workloads. Most core Lua libraries are at least partially implemented, though regular expressions, coroutines, and string.dump are not supported. Weak reference tables are explicitly not supported due to Go's lack of weak reference support.

The project has been battle-tested in production environments since its initial deployment. The compiler successfully processes all Lua test suite files, while the VM correctly executes over a third of the test cases. Development maintains a focus on correctness and compatibility with the Lua specification, as evidenced by the comprehensive test coverage against the official Lua test suite. The performance characteristics stem from deliberate architectural choices, particularly the heap allocation of stack frames with separate variant structs, which prioritize compatibility and debugging capability over raw speed.