Jon Gjengset
Watch video

Sguaba: Type-safe spatial math in Rust

Sguaba is a type-safe spatial math library written in Rust that handles coordinate system transformations for 3D space. The talk covers the complexity of spatial math — including local body frames (FRD, FRU), local tangent planes (NED, ENU), and global reference systems (WGS84, ECEF) — and explains why getting these conversions wrong is easy and costly. Sguaba encodes every coordinate frame as a distinct Rust type, uses the typestate builder pattern to enforce valid construction, and chains quaternion-based rigid body transforms in a way the compiler verifies. Unsafe is used unconventionally to mark places where the caller must assert runtime facts (e.g., a plane's GPS position) that cannot be statically verified, making type-safety violations visible. The library is available on crates.io with extensive documentation and property-based tests.

    #rust
May 31•50m watch time
Jon Gjengset's image
Jon Gjengset

0 Followers

•

8 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard