HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
yuin
gopher-lua
Go2015–2026
yuin / gopher-lua

gopher-lua

GopherLua: VM and compiler for Lua in Go

12Distinct people
13Mentions
0Explicit recommenders
7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

GopherLua: VM and compiler for Lua in Go

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year13 dated mentions

Observed mentions: 2015-02-21 16:30:50 UTC to 2026-05-13 07:23:50 UTC.

012342015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC413
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC202
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC202
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC202
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC000
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

What Hacker News says

13 sources
Agreed, it made a lot more sense to write MaraDNS in C in 2001 though. The main advantage of writing in C over Rust here in 2026 is that C has two different Lua interpreters, and there isn’t a port of Lua to Rust yet; [1] yes, there are ways to use the C version of Lua in Rust, but that’s different. If I were to write a new server today, I could very well write it in Go, then use GopherLua for the Lua engine: https://github.com/yuin/gopher-lua Although, even here, the advantage of C is that I could increase performance by using LuaJIT: https://luajit.org/luajit.html [1] If I were to use Rust, I would consider using Rune as an embedded language as per https://rune-rs.github.io/
In CERT is releasing six CVEs for serious security vulnerabilities in dnsmasq
Surprised recent versions 1.18+ didn't see a jump in improvement, but might explain sumloop improvement for 1.19 I checked, they use switch on opcodes in vm.go. So would expect a recent improvement, but probably only <5%, & I didn't look close enough to see if awk is one of those languages where instruction dispatch matters less (like how APL tends to avoid issues since array ops avoid having dispatch in tight loops, or how Python avoids instruction dispatch overhead when using numpy) Indeed, they have a comment saying array of functions is faster for older versions of go: https://github.com/benhoyt/goawk/blob/158232a76856e12d680a53... For VMs Go had a problem for large switch statements: it would always use binary search instead of a jump table. This caused gopher-lua & go-lua to both take the route of having an array of functions which
Read the rest
they call on to dispatch instead A couple years ago this was fixed: https://go-review.googlesource.com/c/go/+/357330 I measured a small perf improvement switching gopher-lua to switch: https://github.com/yuin/gopher-lua/pull/479 edit: looking closer, not sure `compiler.CallBuiltin` is doing them a favor anymore. They seem to have a lot of double dispatch operations (like `compiler.AugAssignField`) which would be less impactful with binary search switch
In Go performance from version 1.0 to 1.22
Not the parent but there are several high quality native (meaning no CGO) Lua implementations for Go and it's a great choice if you want an embedded scripting language: https://github.com/yuin/gopher-lua https://github.com/Shopify/go-lua Unless you specifically need a JVM either of these will be a much more practical and mature choice for embedded scripting. Alternatively if you prefer JS then Otto is a good choice: https://github.com/robertkrimen/otto
In Jacobin: A more than minimal JVM written in Go
I'm generally using Visual Studio Code for all my development. Really like it. I chose https://github.com/yuin/gopher-lua as the Lua engine because it is Golang-based, while the Nginx Lua VM is C, unless I'm mistaken. Using gopher-lua is just easier when I'm working in a Golang project. I only have to work in a single language and dev environment for all the backend work. Makes both development and testing easier. Moonscript I might have heard of, but I have no experience with it. I did not consider it here, and I would rarely consider any niche scripting language for a solution I want others to use. It just introduces an unnecessary barrier to adoption.
In Show HN: Supershields.io – smart, Lua-powered SVG status badges
GopherLua [0] is a Lua implementation written in Go, not just a wrapper around the reference implementation (written in C). The main alternative seems to be Shopify’s go-lua [1], given that Microsoft’s golua [2] is no longer being developed. The main difference between these three implementations seems to be the supported Lua version - 5.1, 5.2 and 5.3 respectively. Of course, the reference implementation is now on version 5.4 - these are all considered different major versions of the language (Lua doesn’t use SemVer). [0] https://github.com/yuin/gopher-lua [1] https://github.com/Shopify/go-lua [2] https://github.com/Azure/golua
In Show HN: LadyLua, batteries-included static Lua 5.1 interpreter
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])
In GopherLua: VM and Compiler for Lua in Go

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.