Sign inSign up

100hellos/hare

By 100hellos

•Updated 4 months ago

"Hello World!" Written in hare

Image
0

4.6K

100hellos/hare repository overview

⁠Hello World! From hare.

Language page⁠ — context, influences, and learning notes on the 100hellos site.

Source on GitHub⁠ (100hellos/hare)

⁠Trying it

docker run --rm --platform="linux/amd64" 100hellos/hare:latest

⁠Modifying it

Read the repo README⁠, or fork the project⁠ and customize it.

For an interactive shell:

docker run --rm --platform="linux/amd64" --entrypoint="" -it 100hellos/hare:latest zsh

⁠Hare

Hare is a systems programming language designed by Drew DeVault⁠. It targets POSIX-like kernels and produces statically linked, MUSL-compatible ELF binaries by default—perfect for the Alpine-based images used in 100hellos.

⁠Why it's interesting

  • Simple toolchain: The single hare driver wraps the compiler (harec), QBE backend, assembler, and linker.
  • Safety without GC: Memory-safe idioms such as slices, option types, and bounds-checked arrays, yet no runtime garbage collector.
  • First-class cross-compilation: hare build -t aarch64 produces binaries for other architectures with zero extra flags.
  • Low-level pragmatism: Familiar C-style syntax, but modern features like modules, defer statements, and algebraic data types.

⁠Hello World explained

use fmt;

export fn main() void = {
    fmt::println("Hello World!")!;
};
  • use fmt; imports the fmt standard-library module for formatted I/O.
  • export fn main() marks the entry point that will be visible to the linker.
  • The trailing ! after println propagates any I/O error (similar to Rust's ?).
  • ; terminates the block with an explicit semicolon—a Hare quirk.

⁠Try it yourself (inside the container)

# Build a static binary
hare build -o hello hello-world.ha
./hello

Or iterate quickly:

hare run hello-world.ha

⁠Further exploration

  • Official site & docs: https://harelang.org⁠
  • Community IRC: #hare on Libera.Chat
  • Blog post "Cross-compiling Hare programs is easy" for multi-arch builds.

Tag summary

Content type

Image

Digest

sha256:2e325f59d…

Size

107.9 MB

Last updated

4 months ago

docker pull 100hellos/hare