You don't need CGO to use SQLite in your Go binary

At least not for most use cases. You can just use modernc.org/sqlite instead as your SQLite driver. For people who aren’t in the Go know, “pure” Go programs are trivially easy to compile cross-platform to all the major platforms by default. You read that right - you can just go build a single Windows executable, Mac executable, and Linux executable on the same machine and just ship it: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 # This can all happen on the same box! export CGO_ENABLED=0 # no c cross-compilation please export GOOS=linux GOARCH=amd64 go build -o hello-linux-amd64 hello.go GOARCH=arm64 go build -o hello-linux-arm64 hello.go export GOOS=darwin # aka mac GOARCH=amd64 go build -o hello-darwin-amd64 hello.go GOARCH=arm64 go build -o hello-darwin-arm64 hello.go export GOOS=windows GOARCH=amd64 go build -o hello-windows-amd64.exe hello.go GOARCH=arm64 go build -o hello-windows-arm64.exe hello.go This was the real reason I chose Go over Python for tsk, my instant-search Finnish to English pocket dictionary. I wanted to be able to give Windows users a single .exe they could just run and have work out of the box. ...

July 18, 2025

SQLite is learnable

This is a response to pid1.call’s “Siren Call of SQlite on the Server”, which itself is a response to articles like Wesley Aptekar-Cassels’s “Consider SQLite” espousing SQLite as a server-side technology. Cards on the table, I both love SQLite and think pid1 has the more correct take here. When I decided on a dime after college to move countries and be with my wife, part of the package deal was that I had to throw away my dreams of easing into the software industry by resting on the laurels of my strong, but not MIT-level-known-worldwide-strong, alma mater (sorry Wildcats). Electrical engineering was just not going to be feasible for a then-monolingual English speaker in Finland, and besides, I majored in it 90% out of curiosity anyway. I always intended to return to my once and future home, the shell, after my Rumspringa with electrons. ...

February 18, 2025