Index

Welcome to Terbium, a site about programming, my stuff, and occasionally some philosophy. This site is written by Matt, a programmer on the US East Coast.

Full archive • Tech posts • Other ramblings • Projects and publications • Recent changes.

Recent posts

Dynamic and lexical scoping (26 November 2026)

Almost all contemporary languages use lexical scoping to resolve variable names to their values, but it didn’t start out this way. Early Lisp famously used dynamic scoping instead, and it remains in use in Bash, Emacs Lisp, and various other deranged languages. What is it? Why was it used? Why did it go away? And when is it still helpful? Read on to get the answer to these riveting questions.

Typeclasses from scratch (25 October 2021)

In this post, I want to introduce the concept of typeclasses (aka traits). Typeclasses are the primary way to do ad hoc polymorphism in languages like Rust and Haskell, and one option for it in Scala. They are comparable to interfaces in class-based object oriented languages, but have different tradeoffs.

Egyptian multiplication and its legacy (6 July 2021)

Ancient Egyptians used a non-positional system for writing numbers. It was based on signs which each represented a power of 10, and which were repeated to specify a number:

Why does insurance work? (10 April 2021)

Insurance works because expected value is linear, but standard deviation isn’t.

Book review: The Problem of Pain (18 March 2021)

A summary and discussion of The Problem of Pain by C. S. Lewis, ISBN 9780060652968. (The text is available online in various formats, for instance here.) The book is about the problem of the existence of human suffering in the presence of an omnipotent and good God, often known as the problem of evil.