Gord Stephen

Bits and things

Hare

I like to think of C and Haskell as my two favorite programing languages that I (almost) never use. While they inhabit opposite ends of the programming language spectrum – C isn’t much more than a minimal convenience layer over assembly code, while Haskell is all about representing logic in terms of abstract mathematical concepts, far removed from the messy realities of computing hardware – they both espouse a certain conceptual minimalism that I quite appreciate.

In spite of that, neither is my go-to language for daily work. C is so minimal that common tasks like string manipulation and error handling become overly complicated and error prone. The language is also a victim of its own success, with decades of ubiquity locking in sometimes-awkward syntax and design decisions. Meanwhile, while Haskell source code is a thing of beauty, it’s also so abstracted from concrete computational actions that performing what should be simple tasks (in terms of processor instructions) and reasoning about code performance is much more complicated than it needs to be.

In practise, I usually find myself settling for a language that strikes a more pragamatic balance between these two extremes. Julia, Rust, Go, and Zig are all interesting modern alternatives making different design tradeoffs, but they all also tend to be just a little more complicated than I think I need for the small, ‘aggressively simple’ kinds projects I like to work on for fun. I’ve taken to working in POSIX(ish) shell for many of these kinds of projects, but let’s not kid ourselves, as a ‘proper’ programming language a shell (of any variety) kind of sucks.

For all these reasons, when Drew DeVault started hinting that he was working on a “C-but-cleaner-simpler-and-more-elegant” programming language, first on his now-defunct Mastadon and later on his blog, I was very much interested. Drew pursues software simplicity even more aggressively than I do, while also building and maintaining a truly prolific and diverse portfolio of open source software projects.

A few years of not-always-so-private development later, and the language (called Hare) was released publicly last month.

I’m neither a Hare expert nor a programming language expert, but am quite intrigued with the language and plan to try it instead of C for a small few projects I’ve had on the backburner for a while, and will post about those experiences here.

If you’re interested, you can find out more about Hare on the official website. There’s a formal specification that provides the gory details of the language definition, as well as a more conversational introductory tutorial (mostly, although not entirely, complete as of the time of writing), which I’ve enjoyed working through.