Lunar, a "fast", memory-efficient Lua 5.1 VM written in Go
Details
- External ID
- 49156306
- Source
- HN
- Company
- —
- Product
- Lunar, a "fast", memory-efficient Lua 5.1 VM written in Go
- Website domain
- github.com
- Launched
- Aug. 3, 2026
- Cohort
- —
- Upvotes
- 8
- Upvotes percentile
- 0.4731182795698925
- Tags
- —
- Fetched at
- Sept. 10, 2026, 5:32 a.m.
- Updated at
- Sept. 10, 2026, 5:32 a.m.
Description
I'm releasing Lunar, a new Lua 5.1 compiler and virtual machine written entirely in Go. It includes the standard libraries, coroutines as well as supporting Lua 5.2-style goto.The embedding API avoids the Lua C API’s stack-based interface in favor of typed Go values and callback frames. Libraries and script-file access are opt-in, so the host explicitly controls what Lua code can access.On my current benchmarks and use-cases, Lunar is often ~1.5x to 2x faster than GopherLua and Shopify’s go-lua. Its largest improvement however is memory use: loading a 9 MB CBOR-derived object graph (hundreds of thousands of tables) allocates about 107 MB versus 785 MB with GopherLua, with roughly 72 MiB versus 542 MiB retained after GC.The public API is still stabilizing, and I’d especially appreciate feedback on the embedding design and Go interface.(Note that this project started in another repo when I still had hopes of porting some of my changes back upstream to another existing library.)
Enrichment
- Theme
- lightweight and on-device AI runtimes
- Vertical
- Horizontal
- Function
- Model & infra
- Audience
- Developer
- AI stance
- Not AI
- Project type
- Hobby / open-source project
- Normalized one-liner
- memory-efficient lua virtual machine
- Manually corrected
- False
Could you build this?
No Writing a full programming language compiler, bytecode interpreter, and memory-efficient virtual machine in Go requires deep, specialized compiler design expertise.
What it would actually take: The project requires building a complete lexical scanner, recursive-descent parser, AST-to-bytecode compiler, and a register- or stack-based virtual machine implementing the Lua 5.1 specification and 5.2 goto semantics. It involves handling Lua coroutines, custom garbage collection interaction with Go's GC, and crafting a zero-alloc value representation (tagged unions or NaN-boxing). This level of language VM engineering demands extensive computer science expertise in formal grammar, bytecode execution, and low-level memory layout.
Discussion
2 comments analyzed.
Competitors
Other products that read as similar to this one — 37 launches clear the similarity bar, closest 8 shown.
Attention rank: #23 of 38 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).
Launched 271 days after the earliest competitor.
- Lunar, a coding harness extensible with Lua · hn · 2026-08-21 · 5 upvotes · similarity 0.47
- Moongate · hn · 2026-03-06 · 287 upvotes · similarity 0.43
- Lude · github · 2026-09-27 · 8 upvotes · similarity 0.40
- I made a Clojure-like language in Go, boots in 7ms · hn · 2026-05-09 · 292 upvotes · similarity 0.39
- Clx · hn · 2026-07-11 · 143 upvotes · similarity 0.38
- Llm.sql · hn · 2026-04-24 · 8 upvotes · similarity 0.38
- We built a <60ms, open-source alternative to E2B using RustVMM and KVM · hn · 2026-04-22 · 7 upvotes · similarity 0.35
- LunarBasic, a BASIC that compiles 2D games to native executables · hn · 2026-08-24 · 6 upvotes · similarity 0.35
Other launches for this product
- No other launches for this product.
Same idea, different domain
Nobody's really built a model & infra tool for Fintech yet.