frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Why Go Rocks for Building a Lua Interpreter

https://www.zombiezen.com/blog/2025/06/why-go-rocks-for-building-lua-interpreter/
35•Bogdanp•3d ago

Comments

ufo•3h ago
I know the author starts the post by saying he won't explain the reasons why he had to write a new Lua interpreter from scratch, but I'm still curious about that. Does anyone know? I dug through some of the links in the post and couldn't find the answer.
Lyngbakr•3h ago
This is exactly the part I got hung up on, too.

    The exact reasons aren’t important for this blog post, but neither the reference implementation [...] nor the other open source Go Lua intepreters I could find were a good fit for my needs.
I'm intrigued because presumably the shortcomings of the other implementations are important to how they chose to implement Lua here.
Scaevolus•3h ago
It's for zb, a Bazel-inspired build system that uses Lua instead of Starlark (stripped down python).
mdaniel•2h ago
Zb: An Early-Stage Build System - https://news.ycombinator.com/item?id=41595310 - Sep, 2024 (125 comments)

and the beta announcement was also recently submitted, but without commentary https://news.ycombinator.com/item?id=44290692

shhsshs•2h ago
From the article:

    My Lua data types have a notable difference from C Lua: an ability to be “frozen”.
wavemode•1h ago
Given this is going to be used as a scripting language for a build system, it's possible they are trying to implement a restricted subset of Lua rather than than the full language.
zombiezen•50m ago
Yup, as others have mentioned, it's for zb. I originally outlined some background on design goals for this blog post, but the outline for that section was as big as the outline for the rest of the post, so I cut it. I'll probably write that one up as another blog post in the near future. :)

(Also, my pronouns are she/her.)

jekwoooooe•2h ago
Go rocks for pretty much everything
williamdclt•2h ago
Well done, writing interpreters is fun!

I’m not really sold on why Go would be a particularly good fit for the task, compared to other languages. Seems to be mostly “interfaces are useful for interpreters, and GC means I don’t have to care about memory management” - both of which are true but hardly specific to Go. There’s some form of interface in almost every mainstream language, I think the implementation would be pretty much the same in any GCd language

lopatin•1h ago
I never thought that Go would be a technology of choise for PL stuff. I always considered it more of a Java-lite for Web systems and also for CLI stuff, but here we are! TypeScript rewrote their compiler to Go. Being a compiler, they had no use of piggy backing on the GC, looks like they just liked the language.
3836293648•1h ago
Typescript chose Go specicfically because they didn't rewrite it. Go has close enough semantics to TypeScript that they could write a Go backend for tsc and do a machine port to Go and continue working from that
9rx•1h ago
> I’m not really sold on why Go would be a particularly good fit for the task, compared to other languages.

Can't every language rock for building a Lua interpreter? It isn't a competition.

wavemode•1h ago
I'm surprised there was no mention of implementing Lua's coroutines via Go's goroutines.
andrewmcwatters•14m ago
Not that it's terribly important, but in the Lua circles, the reference implementation is usually referred to as PUC-Rio Lua.
anaempromptu•4m ago
tfw you learn lua so you can build robots on minecraft

I made my VM think it has a CPU fan

https://wbenny.github.io/2025/06/29/i-made-my-vm-think-it-has-a-cpu-fan.html
312•todsacerdoti•6h ago•59 comments

Personal care products disrupt the human oxidation field

https://www.science.org/doi/10.1126/sciadv.ads7908
143•XzetaU8•3h ago•87 comments

Error Handling in Rust

https://felix-knorr.net/posts/2025-06-29-rust-error-handling.html
4•emschwartz•5m ago•0 comments

Show HN: Octelium – FOSS Alternative to Teleport, Cloudflare, Tailscale, Ngrok

https://github.com/octelium/octelium
225•geoctl•9h ago•78 comments

4-10x faster in-process pub/sub for Go

https://github.com/kelindar/event
67•kelindar•5h ago•10 comments

Bloom Filters by Example

https://llimllib.github.io/bloomfilter-tutorial/
142•ibobev•8h ago•16 comments

Using the Internet without IPv4 connectivity

https://jamesmcm.github.io/blog/no-ipv4/
234•jmillikin•12h ago•102 comments

Loss of key US satellite data could send hurricane forecasting back 'decades'

https://www.theguardian.com/us-news/2025/jun/28/noaa-cuts-hurricane-forecasting-climate
113•trauco•2h ago•60 comments

Most ints are not floats

https://www.johndcook.com/blog/2025/06/27/most-ints-are-not-floats/
18•zdw•2d ago•24 comments

The Medley Interlisp Project: Reviving a Historical Software System [pdf]

https://interlisp.org/documentation/young-ccece2025.pdf
57•pamoroso•5h ago•5 comments

Many ransomware strains will abort if they detect a Russian keyboard installed

https://krebsonsecurity.com/2021/05/try-this-one-weird-trick-russian-hackers-hate/
45•air7•2h ago•11 comments

Why Go Rocks for Building a Lua Interpreter

https://www.zombiezen.com/blog/2025/06/why-go-rocks-for-building-lua-interpreter/
35•Bogdanp•3d ago•15 comments

Tools I love: mise(-en-place)

https://blog.vbang.dk/2025/06/29/tools-i-love-mise/
92•micvbang•2h ago•37 comments

Show HN: A tool to benchmark LLM APIs (OpenAI, Claude, local/self-hosted)

https://llmapitest.com/
14•mrqjr•5h ago•2 comments

Show HN: Sharpe Ratio Calculation Tool

https://www.fundratios.com/
6•navquant•2h ago•3 comments

The Unsustainability of Moore's Law

https://bzolang.blog/p/the-unsustainability-of-moores-law
119•shadyboi•13h ago•82 comments

More on Apple's Trust-Eroding 'F1 the Movie' Wallet Ad

https://daringfireball.net/2025/06/more_on_apples_trust-eroding_f1_the_movie_wallet_ad
716•dotcoma•12h ago•467 comments

America's Coming Smoke Epidemic

https://www.theatlantic.com/science/archive/2025/06/wildfire-smoke-epidemic/683343/
52•JumpCrisscross•3h ago•7 comments

Revisiting Knuth's "Premature Optimization" Paper

https://probablydance.com/2025/06/19/revisiting-knuths-premature-optimization-paper/
5•signa11•3d ago•0 comments

Solving `Passport Application` with Haskell

https://jameshaydon.github.io/passport/
275•jameshh•21h ago•108 comments

Scientists Retrace 30k-Year-Old Sea Voyage, in a Hollowed-Out Log

https://www.nytimes.com/2025/06/25/science/anthropology-ocean-migration-japan.html
29•benbreen•3d ago•14 comments

Implementing fast TCP fingerprinting with eBPF

https://halb.it/posts/ebpf-fingerprinting-1/
53•halb•9h ago•20 comments

Brad Woods Digital Garden

https://garden.bradwoods.io
36•samuel246•2d ago•3 comments

Sequence and first differences together list all positive numbers exactly once

https://oeis.org/A005228
65•andersource•4d ago•25 comments

Schizophrenia is the price we pay for minds poised near the edge of a cliff

https://www.psychiatrymargins.com/p/schizophrenia-is-the-price-we-pay
203•Anon84•23h ago•312 comments

The Death of the Middle-Class Musician

https://thewalrus.ca/the-death-of-the-middle-class-musician/
253•pseudolus•22h ago•563 comments

Engineered Addictions

https://masonyarbrough.substack.com/p/engineered-addictions
644•echollama•1d ago•399 comments

Improving River Simulation

https://undiscoveredworlds.blogspot.com/2025/04/improving-river-simulation.html
62•Hooke•3d ago•1 comments

BusyBeaver(6) Is Quite Large

https://scottaaronson.blog/?p=8972
258•bdr•1d ago•188 comments

What LLMs Know About Their Users

https://www.schneier.com/
62•voxleone•4d ago•30 comments