From Fedora Project Wiki

Revision as of 14:22, 26 December 2024 by Dridi (talk | contribs) (Add scope item.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is a proposed Change for Fedora Linux.
This document represents a proposed Change. As part of the Changes process, proposals are publicly announced in order to receive community feedback. This proposal will only be implemented if approved by the Fedora Engineering Steering Committee.

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

  • Targeted release: Fedora Linux 42
  • Last updated: 2024-12-26
  • [<link to devel-announce post will be added by Wrangler> Announced]
  • [<will be assigned by the Wrangler> Discussion thread]
  • FESCo issue: <will be assigned by the Wrangler>
  • Tracker bug: <will be assigned by the Wrangler>
  • Release notes tracker: <will be assigned by the Wrangler>

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)

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 a hare package for review
    • create RPM macros for Hare packaging
      • submit %hare_arches to redhat-rpm-config
    • handle the hare package bootstrap
    • add dependency generators for Hare modules
      • stretch goal: generate BuildRequires too
    • submit upstream changes to support Fedora packaging needs
    • stretch goal: draft packaging guidelines
  • Other developers: N/A (not needed for this Change)
  • Release engineering: N/A (not needed for this Change)
  • Policies and guidelines:
    • There ideally should be Hare packaging guidelines submitted as part of this change, otherwise at a later point.
  • 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