Hare standard library development March 19, 2021 by Drew DeVault

I’m happy to see more contributors getting on board with standard library development! The standard library is extremely important to Hare’s success, and building it is a lot of work, which means we need a lot of help to get it done. This article should serve as an introduction to the standard library development process for new contributors. As a pre-requisite, please complete the Installation procedure and the Hare language introduction.

The standard library lives in the main Hare source tree, and tickets for it are marked with the “stdlib” label on the bug tracker (if you need access to this, ask on IRC). I also recommend reading the standard library mandate, which establishes the scope and goals.

The Hare standard library shall provide:

  1. Useful features to complement Hare language features
  2. An interface to the host operating system
  3. Implementations of broadly useful algorithms
  4. Implementations of broadly useful formats and protocols
  5. Introspective meta-features for Hare-aware programs

Each of these services shall:

  1. Have a concise and straightforward interface
  2. Correctly and completely implement the useful subset of the required behavior
  3. Provide complete documentation for each exported symbol
  4. Be sufficiently tested to provide confidence in the implementation

We have a number of focus areas for standard library development. I expect most contributors, at least at first, to stick to one or two of these areas. The focus areas we’re looking into now are:

Algorithms
Sorting • compression • math • etc
Cryptography
Hashing • encryption • key derivation • TLS • etc
Date & time support
Parsing • formatting • arithmetic • timers • etc
Debugging tools
ELF and DWARF support • vDSO • dynamic loading • etc
Formats & encodings
JSON • XML • HTML • MIME • RFC 2822 • tar • etc
Hare language support
Parsing • type checker • hosted toolchain • etc
Networking
IP & CIDR handling • sockets • DNS resolver • HTTP • etc
Platform support
New platforms and architectures • OS-specific features
String manipulation
Search, replace • Unicode • Regex • etc
Unix support
chmod • mkfifo • passwd • setuid • TTY management • etc

Take a look through the stdlib tickets to find work in your area of interest, and introduce yourself on IRC, where you can meet the people you’ll work with, ask and answer questions, and get help finding things to work on.

This is going to be a lot of work! But, with everyone’s help, it’ll be done in no time. Thanks for being involved <3