Remix.run Logo
Show HN: Hsrs – Type-Safe Haskell Bindings Generator for Rust(github.com)
23 points by suis_siva 5 hours ago | 1 comments

Hey everyone! I've been working on hsrs, a type-safe Haskell Bindings Generator for Rust.

I couldn't really find any bindings generator that would create type-safe, rich bindings for Haskell from Rust. Naturally, both languages have rich type systems, so I was amazed that no awesome bindings generator already existed, hence I decided to write my own. hsrs feels very similar to pyo3 and napi-rs, and if you've used those, hsrs will feel right at home.

What's unique about hsrs as opposed to hs-bindgen is that it has type-safe bindings for rich types, like Result, Maybe, etc. while also generating Haskell bindings. The repo contains a minimal example, and more details are available in the haskell discourse: https://discourse.haskell.org/t/ann-hsrs-ergonomic-haskell-b...

rienbdj 31 minutes ago | parent [-]

Really cool nice job!

With more and more ecosystem libraries being written in Rust (and a Python wrapper) could this be a way to expand the Haskell ecosystem?