~sircmpwn/hare unlisted

A programming language
README.md: use correct build badge
Implement recursive types, somewhat
ha_type_unparse: overhaul


browse  log 



You can also use your local clone with git send-email.

#Hare builds.sr.ht status

Hare is a very WIP and as-of-yet not useful programming language.

#Early development rules

Hello, onlooker! Please keep this project a secret. Feel free to mess around with it and send feedback (we're in #hare on irc.freenode.net), but please keep it to yourself. We don't want to announce this project until it's much, much more mature.


  1. Trust the programmer.
  2. But, provide tools the programmer may use when they don't trust themselves.
  3. Prefer explicit behavior over implicit behavior.
  4. Defined behavior is better than undefined behavior.
  5. In order for a program to be correct, it must be simple.

#In a nutshell

  • Compiles to machine code, using qbe as the backend*
  • Strongly typed, expression-based syntax, pattern matching
  • Small, context-free grammar and a fixed set of language features
  • No runtime, manual memory management, no GC
  • Uses the C ABI and can link directly to C code
    • However, the stdlib does not depend on libc, it can be used in a vacuum
  • First-class tagged unions, slices, and tuples
  • No first-class support for interfaces, generics, or meta-programming

* This means that this is not yet another LLVM frontend, for those following along at home.


You need to have my fork of qbe installed.

mkdir build
cd build
make check # run tests

. ./localenv.sh
# Your shell is now configured to use the newly-built Hare toolchain and stdlib,
# go forth and compile Hare projects


Current status: partway through phase one.

Phase one: language design and bootstrap compiler

The first step is to (1) design the language and (2) write a compiler for it. We refer to this as the "bootstrap compiler" and its main purpose will be compiling the "hosted compiler". The bootstrap compiler is not meant to be ergonomic or pleasant to use - for example, it asserts on incorrect programs instead of reporting errors nicely.

Phase two: hosted compiler, stdlib

Rewrite the compiler in Hare itself and develop enough of a stdlib to support it, and a reasonable number of interesting programs. The bootstrap compiler is designed so that it can be incrementally replaced with the hosted compiler. The intention is to maintain both compiler implementations indefinitely.

Phase three: it's done

Write a specification, freeze the language, expand the stdlib, port to more platforms, and use Hare for new/novel projects.