
Nano-Blog
A collection of short items related to the culture and practice of software development.
§ May 20, 2025
-
We've previously covered small Lisps in the past, but there's an implementation we didn't mention. PicoLisp is a small Lisp which seems to focus on simplicity. It is supported by a vibrant community including Mia Temma's PicoLisp Explored blog.
Well worth the time if you're lambda-curious.
§ May 13, 2025
-
De Moura and Ierusalimschy's Paper on Coroutines
Coroutines have always been a little bit niche. They're quite useful for certain control or parsing tasks, but most programmers will more frequently use regular subroutines, if...else or for loop constructions. That's okay. You use what you're used to.
But if you have a few minutes, try reading this paper from Ana Lúcia De Moura and Roberto Ierusalimschy: Revisiting Coroutines. It's not "short", but it is interesting.
-
The Neco C Language Coroutine Library
Following on from an earlier post about coroutines in C, here is a link to the Neco Coroutine Library. It's clearly designed as a heavy-weight alterntative for people requiring serious I/O. Mostly I'm very happy to see numerous examples on their landing page. Well done.
§ May 12, 2025
-
Larry Wall's Quote About Programming Languages
Larry Wall has a great quote about programming languages:
Programming languages differ not so much in what they make possible, but in what they make easy.
The PERL programming language, invented by Wall, is an example of this quote in action. PERL programs make reading files one line at a time and searching for specific content fairly easy (at least compared to C.) But no one would be crazy enough to write an operating system in it.
-
Simon Tatham's Page About Coroutines in C
Coroutines are an extremely useful abstraction in modern programming. Like regular (sub)routines, they allow a programmer to compose complex tasks from smaller, simpler tasks. But unlike regular (sub)routines, control is passed between (usually) two routines until some exit condition is reached. You wouldn't want to use coroutines for everything, but when you need them, they're great to have in your toolbox of programming techniques.
As useful as they are, coroutines were not included as "first class abstractions" in the C Programming Language. Several people have noticed this lack and built a mix of preprocessor macros and library code to implement coroutines in C. One of the better tested implementations is described in Simon Tatham's page Philosophy of Coroutines. It's not a short read. But it's not long, either. It's well worth the time to read, digest and work through some examples.
§ May 6, 2025
-
Greg Comeau's Guide to Understanding Even the Most Complex C Declarations
Many decades ago Greg Comeau published a good article in Microsoft Systems Journal explaining how to read and construct complex C variable and function declarations. It seems to have fallen off the web, so we mirrored it here. C and C++ seem to be having a bit of a renaissance, likely because younger Rust programmers are wondering what older coders were complaining about. It is recommended reading for anyone who needs to read or write C code.
-
Every programmer knows color is a mix of three primary hues: red, green and blue. But that's not true in the strictest sense. Color perception in humans is complex, beautiful and weird.
Several Color Models have been devised to allow humans to reason about different aspects of color perception. RGB is simply a common model we inherited from an earlier generation of engineers. But it's use on the web for the last thirty years has reinforced its place as "the default."
Recent work by web-boffins is starting to give developers a choice, however. This article, Why We Moved from RGB and HSL by Irina Nazarova, describes her use of the OKLCH and OKLAB color models. Definitely read the whole article, but the TLDR is other color models give developers different abstractions when thinking about color. The OKLAB and OKLCH color spaces make it much easier to reason about hues with the same perceived brightness.
Kate Morley's 12-Bit Rainbow Palette gives a good visual example of why this (OK)LCH color spaces are useful. The palette she devised yields a rainbow of colors, but when you put them next to each other, they seem to have similar apparent brightnesses.
Kate's Rainbow Palette is specified using RGB colors for easy integration with older software. We used it in a few experiments and found it useful to name the colors using CSS variables. Here's an fragment from a CSS definition:
:root { --violet: #817; --yellow: #ed0; --skyblue: #0bc; --maroon: #a35; --green: #9d5; --teal: #09c; --pink: #c66; --seafoam: #4d8; --blue: #36b; --orange: #e94; --cyan: #2cb; --purple: #639; } .test { background-color: var(--teal); }
§ May 5, 2025
-
The Visual Display of Quantitative Information
We live in a delightful time for "user experience." Though several philosophical and practical issues remain, as a species we seem to keep improving our understanding of cognitive science. One practical aspect of this is our increasing understanding of how to present information to maximize understanding. Granted, we're not always good at it, but there's an intellectual framework we can use to reason about effective communication.
One of the first works to talk explicitly about how to structure graphs, charts and tabular numerical data for maximum comprehension was Edward Tufte's The Visual Display of Quantitative Information. Aimed at the non-specialist, this text gently steps readers through examples of how graphs and tables were used used (or abused). Interspersed are discussions of human cognitive capabilities.
Well worth a read.
§ May 4, 2025
-
Jason Fried relates a great story in his blog post "Give it five minutes" about learning to think instead of react. Many times your initial reactions are correct. But other times they will lead you astray.
Fried's post is short. You can read it in a minute or two. The central conceit is not hard to guess from the title: it's often good to wait a few minutes before offering a critique. One line from Fried's post stands out:
There are two things in this world that take no skill: 1. Spending other people's money and 2. Dismissing an idea.
There is an art to delivering useful critique. Maybe mulling over ideas for a few minutes is the first step into the artful world of discourse.
§ May 2, 2025
-
Classic References for Test-Driven Development
In the heyday of the 1990s, before unit tests were mandated by our development methodology, eXtreme Programming teams often practiced "Test-First." At the time it was considered counter-intuitive and controversial. Even within teams who wrote unit tests, questions remained: What should be tested first? What actually is a "unit", anyway?
This was the state of affairs when Kent Beck wrote Test-Driven Development by Example. It describes the theory and philosophy of "test-first" and steps the reader through a few examples. By the end of the text, the reader will have been exposed to examples of how a unit-testing mentality helps development teams avoid common problems.
We also recommend another text, Test-Driven Development: A Practical Guide by Dave Astels. This text picks up where Beck's book ends. It works the reader through several examples using Java. Programming pitfalls are demonstrated through the lens of gradually revealed requirements and code refactoring.
Both texts are well worth the read and should available at your local academic library.