Article may be outdated

This article is 2 days old. Some details may have changed since publication.

Hacker News·3 min read·hard

Show HN: Galois connections for composable numeric casts in Rust

P
partialsolve
Show HN: Galois connections for composable numeric casts in Rust
AI Summary

A new Rust crate has been released that implements Galois connections for safe, lawful numeric type casting. The library focuses on compile-time verification and property-tested invariants to prevent common casting errors.

Galois connections as first-class Rust values. Use them to cast lawfully between numeric types, and compose ladders of conversions whose round-trip behavior is determined by simple inequalities rather than left to chance. Every operation derived from a Conn (rounding, saturation, median, ...) carries a property-tested invariant. The generated fixed-width integer, Q-format, NonZero, and iso families also have Kani harnesses for full bit-width SMT proofs; float SMT coverage is narrower and called out under Testing → SMT verification .

Continue reading on Headlinne

Create a free account to read the full article.

Read full article →
technologyscience

Get the full story

Sign up for Headlinne to unlock AI insights, political bias analysis, and your personalized news feed.

Create free account

Already have an account? Sign in

Show HN: Galois connections for composable numeric casts in Rust — Headlinne — headlinne