{"repo":"harmont-dev/hsrs","free":true,"listed":false,"github":"https://github.com/harmont-dev/hsrs","clone":"git clone https://github.com/harmont-dev/hsrs.git","description":"Type-safe Haskell Rust Bindings","language":"Rust","stars":84,"topics":["haskell","rust","ffi","bindgen","binding-generator","bindings","borsh","cabal","cargo","codegen"],"license":null,"category":"dev-tools","readme_excerpt":"hsrs Call Rust from Haskell with type-safe, automatically generated FFI bindings. Annotate your Rust types and functions, run the code generator, and get idiomatic Haskell that handles memory management, serialization, and type conversions for you. Quick start 1. Annotate your Rust code 2. Generate Haskell bindings 3. Use from Haskell That's it. Memory is managed automatically via ForeignPtr , and complex types like Point are serialized across the boundary with Borsh. Setup Rust side — add hsrs to your crate: Haskell side — add the hsrs runtime package: This pulls in Borsh serialization automatically — no extra dependencies needed. What you can annotate Annotation What it does Haskell result --- --- --- #[hsrs::data type] Opaque struct passed by pointer ForeignPtr newtype with automatic cleanup #[hsrs::enumeration] C-compatible enum ( repr(u8) ) Word8 newtype with pattern synonyms #[hsrs::value type] Struct passed by value via Borsh data record with Borsh deriving #[hsrs::function] Method exported over FFI Type-safe Haskell wrapper #[hsrs::module] Groups a data type with its methods Generates all FFI glue for the type Result becomes Either E T , Option becomes Maybe T , Vec becomes [T] , and String becomes Text — all serialized transparently via Borsh. Supported types Rust Haskell Transfer --- --- --- i8 , i16 , i32 , i64 Int8 , Int16 , Int32 , Int64 Direct (C FFI) u8 , u16 , u32 , u64 Word8 , Word16 , Word32 , Word64 Direct (C FFI) bool CBool Direct (C FFI) usize / isize Wor","default_branch":null,"files":null,"tree":[],"storefront":"/r/harmont-dev","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/harmont-dev/hsrs/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}