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
  • OpenBSD Server: httpd

    I finally got around to writing part 2 of this series. If you have not read part 1 yet, then you can find it here. So now that we have our base server installed, we can go ahead and setup httpd to serve our website. Setup httpd Let’s go ahead and create a very…

    via Bryce Vandegrift's Website
  • I’d like to write about intellectual property in depth, in this first of a series of blog posts on the subject. I’m not a philosopher, but philosophy is the basis of reasonable politics so buckle up for a healthy Friday afternoon serving of it. To understand …

    via Drew DeVault's blog
  • udev (WIP)

    udev enables registering userspace handlers for events. Mostly(?) used to response to peripheral devices. Bullets: is sucessor of devfsd and hotplug udev events are handled in parallel. udef is part of systemd (uhg) § reads https://wiki.archlinux.org/titl…

    via home - SHRIK3 on SHRIK3