“Code golf” refers to finding the shortest program to solve a given task. Although a bit of a niche hobby, there is incredible depth to the tricks and techniques involved. I’ve written a number of articles sharing fun stuff I’ve done in code golf.
JavaScript
Epic code golfing: Wordle challenge: Compressing 13000 5-letter words into 11000 bytes of JavaScript, using techniques from machine learning and modern data compression.
Packing hex numbers in JavaScript: Printing 832 hex digits in 550 bytes of JavaScript, using a novel technique for packing bits into UTF-8 strings that is close to theoretically optimal.
Unicode packing in JavaScript: The 2:1-plus packer: A review of how Unicode packing works in JavaScript golf and an extension I developed.
Python
The 2025 Google Code Golf Championship: A write-up of my experience on the first-place team in this golf competition.