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

The language learning "Delta" Anki card pattern

1 2 3 4 5 +--------------------------+------------------------------------------+ | L2, fixable | L1, intention | +--------------------------+------------------------------------------+ | L2, fixed | L1, (fixable -> fixed) explanation | +--------------------------+------------------------------------------+ The above 2x2 layout for Anki cards, which I call a “comprehensible delta”, is one of the best things I’ve happened upon in a while for learning another language. Let’s say you are learning Finnish, and you want to say ...

June 28, 2025

LLM, JavaScript, GitHub Pages, localStorage: A recipe for free apps anyone can use

Earlier today on Hacker News Scrappy made the rounds, with the explicit tagline “make little apps for you and your friends”. I always like to see new projects in this vein. That’s why I’d like to outline my alternative approach, which Works cross-platform and on mobile devices by default, Doesn’t require any app store tomfoolery, Has great uptime built in, Gives you just enough data persistence to not get in your way, and Is owned by you, forever. This is the stack I used to build my diet checklist, which I keep as a little icon on my phone’s home page. Here it is: ...

June 18, 2025

Create multi-stage Anki card answers with HTML's <details> tag

This works as of, at least, Anki 24.06.3. According to the Mozilla Developer Network, The <details> HTML element creates a disclosure widget in which information is visible only when the widget is toggled into an open state. In standard web browsers, absent any CSS to the contrary, a <details> tag starts closed until further notice. Since Anki is basically a local web browser on top of a timer, this also works there. ...

June 7, 2025

Cross-platform TUIs are easier than cross-platform GUIs

Below is a GIF of tsk, my pocket Finnish-to-English dictionary, running in my terminal emulator of choice under Linux. It’s what the kids call a TUI, a graphical program that just happens to drive its graphics using terminal graphics instead of graphics-graphics. Insert GIF here. You can probably tell that this program fits neatly into the “home-cooked meal” clade of programs. There is a very straightforward problem I want solved - fast, single-executable-portable dictionary lookup, with a few conveniences for the busy language learner layered on top. I am quite happy with tsk in its current iteration and don’t plan to add much more to it anytime soon. It would still save me a lot of time and hassle if I were the only person who could use it. ...

May 20, 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

PHP, Go, and Braindead Deployment

If you’ve been following my posts recently, you might have noticed that I’ve been working more and more with PHP lately. As someone who was curiously allergic to web dev as a teenager, it has been a strangely healing experience for me. I’d like to say it’s because my experiments with Laravel, the only OSS work of which I can point to is testing the Homestead VM’s compatibility for Shell Bling Ubuntu, convinced me. But no – Laravel is pretty sweet, but so is Django, but Django has the advantage of using an underlying language that ...

September 16, 2024

The highest personal ROI program I have written so far

It would have to be finstem, a simple command-line program I wrote to reduce Finnish words down to their root form. Finnish is a lot like Latin or Russian in that its words often become lumbering behemoths of rewritten consonants, suffixes upon suffixes, and this makes it hard to look up in a dictionary – that is, until you factor in its very regular orthography and the phenomenal efforts of the Finnish programming industry: finstem is basically a very specialized UI for the OpenOffice spell checker, and I have no shame in admitting that. ...

July 30, 2024

Layers of abstraction for me, not for thee

Consider the problem of “how do I run more than 1 terminal at a time”. At this moment, I have at least 5 different ways I can effectively solve this issue: I can, from a different physical computer, SSH in to a new session. I can, from the same physical computer, switch to a different tty session with … C-S-F2 through 6 or something. (Rare, but sometimes it comes in really handy.) I can, in the same user session, open 2 separate windows of a terminal emulator. I can, in the same terminal emulator, open a new tab. I can, in the same emulated terminal, run tmux and open a new pane. There are yet more exotic options like Serial over LAN that I’m only theoretically aware of. ...

June 18, 2024

Trackballs are great for the mostly-mouseless

I was 100% mouseless back before it was cool. Between dropping out of high school and enrolling in community college, I replaced my laptop with a $80 HP EliteBook I found on eBay; when I discovered its trackpad didn’t work anyway, I went all in on a no-X setup. I eventually concluded that going 90% mouseless got me almost all of the benefits, with almost none of the downsides. It’s almost as if returns are usually diminishing! ...

May 26, 2024