# HSRS

> **TL;DR.** HSRS is a code-generation tool that produces type-safe Haskell bindings for Rust libraries via procedural macros.

- **Category:** Developer Tools / Language Interop / Rust Ecosystem
- **Stage:** emergent
- **Age:** 20 days
- **Origin date:** 2026-05-14
- **First detected:** 2026-05-19
- **Canonical URL:** https://earlyterms.com/term/hsrs
- **Sources:** 5 primary URLs

## Definition

HSRS is a code-generation tool that produces type-safe Haskell bindings for Rust libraries via procedural macros. Annotate Rust types and functions with `#[hsrs::*]` attributes, run the codegen CLI, and receive idiomatic Haskell that handles memory management, serialization, and complex type conversions automatically.

Created by harmont-dev and [published on GitHub on May 14, 2026](https://github.com/harmont-dev/hsrs), HSRS announced on the Haskell Community Discourse and reached Hacker News on May 19, 2026. Its key differentiator over the older [hs-bindgen](https://github.com/yvan-sraka/hs-bindgen) is support for rich Rust types — `Result<T,E>` maps to `Either E T`, `Option<T>` to `Maybe T`, `Vec<T>` to `[T]` — via Borsh serialization across the FFI boundary.

## Analogy

Think of it as PyO3 for Haskell: annotate Rust, generate idiomatic bindings, ship.

## Why it's emerging now

Rust is absorbing much of the systems-programming ecosystem — parsers, serializers, cryptography, ML runtimes — and Haskell projects increasingly need those libraries without rewriting them. HSRS launched May 14, 2026 to close that gap with PyO3-style ergonomics, and its HN debut on May 19 surfaced community appetite for a well-maintained solution after hs-bindgen stalled.

## Related terms

- *competitor:* hs-bindgen
- *related:* PyO3
- *related:* napi-rs
- *parent:* Foreign Function Interface (FFI)
- *related:* Borsh serialization
- *related:* ocaml-rs
- *related:* wasm-bindgen
- *parent:* Rust ecosystem
- *related:* bun-s-rust

## Sources

1. [harmont-dev/hsrs — Official GitHub repository (37 stars, MIT/Apache-2.0)](https://github.com/harmont-dev/hsrs)
2. [Haskell Discourse: ANN hsrs — Ergonomic Haskell Bindings for Rust (May 19, 2026)](https://discourse.haskell.org/t/ann-hsrs-ergonomic-haskell-bindings-for-rust/14129)
3. [Hacker News: Show HN — Hsrs Type-Safe Haskell Bindings Generator for Rust (May 19, 2026, 49 pts)](https://news.ycombinator.com/item?id=48189044)
4. [yvan-sraka/hs-bindgen — predecessor C-FFI binding tool (72 stars)](https://github.com/yvan-sraka/hs-bindgen)
5. [IOG Engineering: One step forward — easier interoperability between Rust and Haskell (hs-bindgen background)](https://engineering.iog.io/2023-01-26-hs-bindgen-introduction/)

---
_Generated by EarlyTerms · https://earlyterms.com/term/hsrs_
