One year of writing Hare


It has been a little over a year when I began learning the Hare programming language, and used it almost exclusively for the majority of my projects since. The whys and the wherefores of my interest in this particular niche language was predominantly boredom, shortly after my commitment to a startup came to a close. I had known about Hare several months prior, so I was eager to give it a try.

Before anything else, Hare’s tidy standard library and the incredibly tiny toolchain deserve a praise. Bootstrapping Hare takes mere seconds. The following table shows how long it took to compile each dependency on my Pentium E5700 with -O2 -march=core2:

dependency compile time
qbe 12s
scdoc 1s
harec 11s
hare tools 7s
total 31s

The result is a small language that is fun to hack on. In fact, I was able to get a standalone Hare program to run on Windows after few hours of tinkering with qbe1 (I know, porting the stdlib is the real problem). Supporting new platforms or exotic operating systems should be met with little friction, by virtue of the well confined scale of Hare.

This learning endeavor has changed me as a programmer, I used to be unable to picture myself writing in a paradigm other than object oriented programming. Fortunately, not having to think about the complicated nature of “idiomatic OOP”, or the needless use of certain absurd patterns, was a refresher I had long desired for. Procedural programming has given me enough room to only focus on writing logic, and not waste time on the representation of the problem at hand in a hierarchy of classes. Also reading stdlib modules, typically rt, has significantly helped my understanding of operating systems, and was enjoyable.

There is little for me to dislike in Hare, actually, nothing comes to mind as of writing, but I do have some nitpicks: The compiler in some cases produces vague error messages, no shared library build type2, and maybe the lack of tuple matching. Hare did a good job in staying simple for a system programming language, while enhancing over C’s poor memory safety. However, despite the improvement over C, most programs are prone to memory leaks3, dangling pointers, and the dangerous use of pointer casting, which necessitates to exercise caution with your coding practices.

I had fun programming for the past year. Most of my time in Hare was spent in writing language parsers and interpreters (one for Scheme, and an attempt at an ECMAScript implementation), they aren’t meeting the quality I’d liked though. I will definitely continue using Hare for the foreseeable future, seeing that I have more faith in this project than before I started. One thing I am definitely looking forward to is 32-bit support and Plan9 port.


  1. Few days later, I came across a WIP branch for Windows ABI support in qbe. ↩︎

  2. Linking to C libraries is supported. Drew DeVault is just not a fan of dynamic linking hence why I think shared libraries as a build output is not a priority for now. ↩︎

  3. A research on linear types is in the Hare roadmap, which could eliminate the trivial causes of memory leaks. ↩︎

Articles from blogs I read

Generated by openring
  • There's a common narrative that Microsoft was moribund under Steve Ballmer and then later saved by the miraculous leadership of Satya Nadella. This is the dominant narrative in every online discussion about the topic I've seen and it's a commo…

    via danluu.com
  • In November of last year, I wrote Richard Stallman’s political discourse on sex, which argues that Richard Stallman, the founder of and present-day voting member of the board of directors of the Free Software Foundation (FSF), endorses and advocates for a ha…

    via Drew DeVault's blog
  • First Livestream Soon

    I’ve recently decided that I’m going to do a livestream. This livestream is mostly just a test, but feel free to stop on by if you want to. I have no idea what to expect…so I’ll see how this goes. The stream will start on August 7 at 5:30 PM (EST). The link i…

    via Bryce Vandegrift's Website