From Fedora Project Wiki

Hare Programming Language

Summary

Introduce packages for Hare, a systems programming language designed to be simple, stable, and robust. Hare is still under development, the language, its standard library and its reference tool chain are still subject to breaking changes.

Owner

Current status

Detailed Description

Hare is a systems programming language designed to be simple, stable, and robust. Hare uses a static type system, manual memory management, and a minimal runtime. It is well-suited to writing operating systems, system tools, compilers, networking software, and other low-level, high performance tasks.

The Hare tool chain on Fedora will include:

  • hare (build driver)
  • harec (compiler front-end, already available in Fedora)
  • qbe (compiler back-end, already available in Fedora)
  • binutils (for assembly and static linking)
  • gcc (for dynamic linking, it also works with other C compilers)

Leaving binutils and GCC aside, bootstrapping a Hare tool chain only takes a few minutes. The Hare tool chain can target the x86_64, aarch64 and riscv64 architectures, and will be configured to rely by default on gcc-<arch>-linux-gnu and binutils-<arch>-linux-gnu for cross compilation.

The hare source package will produce the following packages:

  • hare (build driver, haredoc utility and manuals)
  • hare-stdlib (standard library)
  • hare-rpm-macros (packaging utilities)

In addition, a hare-update package will be provided to assist Hare developers deal with breaking changes when a new Hare release is available, until the language and its standard library become stable.

Feedback

None.

Benefit to Fedora

Developers can begin using the Hare language in their projects. Package maintainers can ship applications written in Hare.

Unlike other language tool chains, Hare modules are meant to be the responsibility of system package managers like DNF. Packaging Hare modules and applications should result in little friction.

Scope

  • Proposal owners:
    • submit hare and hare-update packages for review
    • create RPM macros for Hare packaging
      • %hare_arches already submitted to redhat-rpm-config
    • handle the hare package bootstrap
    • add dependency generators for Hare modules
    • draft packaging guidelines
  • Other developers: N/A (not needed for this Change)
  • Release engineering: N/A (not needed for this Change)
  • Trademark approval: N/A (not needed for this Change)
  • Alignment with the Fedora Strategy: none

Upgrade/compatibility impact

The Hare specification is still a draft, so the Hare language, tool chain and standard library are still subject to relatively frequent breaking changes. Package updates containing breaking changes should be limited to Fedora releases.

How To Test

Once the hare package is available, the upstream [introduction https://harelang.org/tutorials/introduction] to the language walks you through the hello world below before covering language concepts.

Hello world:

$ cat >main.ha <<EOF
use fmt;

export fn main() void = {
        fmt::println("Hello world!")!;
};
EOF
$ hare build -o example main.ha
4/4 tasks completed (100%)
$ ./example
Hello world!

User Experience

Dependencies

None.

Contingency Plan

  • Contingency mechanism: N/A (not a System Wide Change)
  • Contingency deadline: N/A (not a System Wide Change)
  • Blocks release? N/A (not a System Wide Change)

Documentation

Release Notes