HeadlinesBriefing favicon HeadlinesBriefing.com

Herd Language: A Value-Only Programming Language

Hacker News: Front Page •
×

A hobby project called Herd introduces a simple interpreted language where every type, including lists and dicts, is passed by value. Built with Rust, Cranelift for JIT compilation, and LALRPOP for parsing, it enforces strict immutability unless variables are explicitly declared mutable. The creator built it to learn language implementation, moving far from the original Crafting Interpreters foundation.

The core technical innovation is its copy-on-write reference counting, which modifies data in-place only when a single reference exists. This guarantees no side-effects on other copies of a value, eliminating the need for complex cycle detection. Compared to Swift or Matlab, Herd aims for simpler value semantics, making it a focused experiment in predictable, functional-style programming without hidden mutations.

While positioned as a non-production tool, Herd offers a clear look at value semantics in practice. Its standard library includes modules for IO, List, Dict, and Parallel operations. The project’s evolution, including recent AI-assisted commits, highlights a modern approach to language creation. Watch for community forks exploring its unique approach to mutability and memory management.