RSSAmplifier

Blog

Ben Hoyt's technical writing

RSS feed for Ben Hoyt's technical writing

benhoyt.comRSS feed ↗55 posts

Latest posts

Fun with an indecisive AI coding agent

In which I have some fun with Claude Opus 4.6, a seemingly indecisive AI coding agent.

Every dependency you add is a supply chain attack waiting to happen

Dependencies are a huge supply chain security risk; the more of them you have, and the more often you update, the bigger the attack surface.

Don't fear Python subprocess or Go codegen

Discusses some design choices used in Jubilant: Python subprocess.run to wrap a CLI tool, a code generator to convert Go structs to Python dataclasses, and the use of uv with a simple Makefile to run commands.

Go performance from version 1.0 to 1.22

Shows how much the performance of Go has improved from version 1.0 through to 1.22 (including PGO) -- in its compiler, runtime, and libraries.

The One Billion Row Challenge in Go: from 1m45s to 3.4s in nine solutions

How I solved the One Billion Row Challenge (1BRC) in Go nine times, from a simple unoptimised version that takes 1 minute 45 seconds, to an optimised and parallelised version that takes 3.4 seconds.

Switching from S3 to Tigris on Fly.io

How I switched my side project from using Amazon S3 for file hosting to using Tigris (which is built on Fly.io infrastructure). It was a good experience overall, but there were a few quirks.

Discussing Forth, C, CGI, Python, Go, and AWK on "Stray Pointers"

This is a transcription of Jim Lawless's interview with Ben Hoyt on his Stray Pointers podcast. We discuss Forth, C, CGI, Python, Go, and AWK.

"Stray Pointers" interview

Not technical writing, but Jim Lawless interviewed me on his "Stray Pointers" podcast. We discuss Forth, C, CGI, Python, Go, and AWK.

Using a Markov chain to generate readable nonsense with 20 lines of Python

Describes a simple Markov chain algorithm to generate reasonable-sounding but utterly nonsensical text, and presents some example outputs as well as a Python implementation.

How (not) to apply for a software job

Advice for how to (and how not to) apply for a software engineering job, particularly for the written parts of the interview process. As a bonus, some tips for your resume/CV.

The AWK book's 60-line version of Make

A discussion of the minimal version of Make included in 'The AWK Programming Language', as well as a Python port of the AWK program.

Using the WordStar diamond in 2023

Describes the WordStar diamond, a wonderful set of key bindings from the 1970s, and how you can use it in 2023 on Linux or Windows.

Name before type: why 'age int' is better than 'int age'

A variable's name is more important than its type, so the name should be more prominent and come first in declarations.

The proposal to enhance Go's HTTP router

A brief look at the proposed enhancements to the Go standard library HTTP request router, net/http.ServeMux: matching on HTTP method, and supporting wildcards in matched paths.

Scripting with Go: a 400-line Git client that can create a repo and push itself to GitHub

In which I rewrite my toy pygit client in Go to see how suitable Go is for simple scripts.

Names should be as short as possible while still being clear

Short, meaningful names that take context into account are better than long, verbose names that don't.

Lookup Tables (Forth Dimensions XIX.3)

An article about lookup tables in Forth that I co-authored with Hans Bezemer (creator of 4tH) when I was 16.

For Python packages, file structure != API

When designing Python packages, decoupling the file structure from the package's API makes your package easier to import and use.

Designing Pythonic library APIs

Principles I've found useful for designing good Python library APIs, including structure, naming, error handling, and type annotations.

From Go on EC2 to Fly.io: +fun, −$9/mo

How I switched hosting my Go-based side projects from Amazon EC2 to Fly.io, significantly simplified deployment, and saved a bit of cash while I was at it.

Code coverage for your AWK programs

This article describes GoAWK's code coverage support, which was contributed by Volodymyr Gubarkov.

I/O is no longer the bottleneck

In 2022, disk I/O is very fast, and not usually the performance bottleneck in programs. This article digs into some numbers.

microPledge: our startup that (we wish) competed with Kickstarter

What our crowdfunding startup microPledge was, why it failed, and what we learned from the process.

Rob Pike's simple C regex matcher in Go

Translating Rob Pike's simple and elegant C regex matcher to Go.

Tools I use to build my website

How I build my website benhoyt.com with GitHub Pages, Jekyll, a simple HTML+CSS layout, Sublime Text, and Sublime Merge.

Modernizing AWK, a 45-year old language, by adding CSV support

Why and how I added proper CSV support to GoAWK, my POSIX-compatible AWK interpreter.

Prig: like AWK, but uses Go for "scripting"

Describes Prig, which is for Processing Records In Go. It's a text processing tool like AWK, but it uses Go as the scripting language.

Go performance from version 1.2 to 1.18

Shows how much the performance of Go has improved from version 1.2 through to 1.18 -- in its compiler, runtime, and libraries.

Optimizing GoAWK with a bytecode compiler and virtual machine

How I sped up GoAWK by switching from a tree-walking interpreter to a bytecode compiler and virtual machine interpreter.

AWKGo, an AWK-to-Go compiler

A discussion of AWKGo, a simple compiler that translates a useful subset of the AWK text processing language into Go source code.

Improving the code from the official Go RESTful API tutorial

My re-implementation of the code from the official Go tutorial 'Developing a RESTful API with Go and Gin', using only the standard library, adding tests, and fixing issues.

Simple Lists: a tiny to-do list app written the old-school way (server-side Go, no JS)

Simple Lists is a tiny to-do list web application written in Go, with old school server-side rendering and no JavaScript.

Structural pattern matching in Python 3.10

A critical but informative look at the new structural pattern matching feature in Python 3.10, with real-world code examples.

Mugo, a toy compiler for a subset of Go that can compile itself

An overview of Mugo, a single-pass compiler for a tiny subset of the Go programming language -- just enough to compile itself.

How to implement a hash table (in C)

An explanation of how to implement a simple hash table data structure, with code and examples in the C programming language.

Performance comparison: counting words in Python, Go, C++, C, AWK, Forth, and Rust

Performance comparison of counting and sorting word frequencies in various languages (Python, Go, C++, C, AWK, Forth, Rust, and others).

The small web is beautiful

A vision for the "small web", small software, and small architectures. Also, a bonus rant about microservices.

Coming in Go 1.16: ReadDir and DirEntry

A look at the new os.ReadDir function and os.DirEntry interface coming in Go 1.16, with a comparison to os.scandir in Python.

Fuzzing in Go

An overview of fuzz testing and the go-fuzz tool, as well as a look at the recent draft design for including fuzz testing in the `go` tool (LWN.net).

Searching code with Sourcegraph

A look at Sourcegraph, a code search and code intelligence tool (LWN.net).

Different approaches to HTTP routing in Go

Compares routing techniques in Go, including five custom approaches and three using third-party routing libraries.

Go filesystems and file embedding

A presentation of the Go draft designs for a filesystem interface and a standard way to embed files in a Go binary (LWN.net).

The sad, slow-motion death of Do Not Track

Talks about the valiant but almost-dead 10-year effort to prevent tracking with the Do Not Track header.

What's new in Lua 5.4

An overview of the new features in Lua 5.4 (LWN.net).

Hugo: a static-site generator

An overview of Hugo, a flexible static website generator written in Go and optimized for speed (LWN.net).

Generics for Go

Gives some background, the current state, and potential timeline for including generics in the Go programming language (LWN.net).

More alternatives to Google Analytics

Looks at some heavier replacements for Google Analytics, as well as the GoAccess log-based analytics tool (LWN.net).

Lightweight Google Analytics alternatives

Discusses what Google Analytics tracks, and presents two lightweight alternatives: GoatCounter and Plausible (LWN.net).

An intro to Go for non-Go developers

A brief introduction to Go for programmers who haven't used Go before: Why use it? The standard library. And the language itself.

ZZT in Go (using a Pascal-to-Go converter)

Describes my port of Adrian Siekierka's "Reconstruction of ZZT" to Go, done in a semi-automated way using a Pascal-to-Go converter.