I wrote my M.Sc. thesis on using the Rust type system in 3D graphics
⚓ Rust 📅 2026-06-29 👤 surdeus 👁️ 3The thesis provides background on 3D graphics, type systems, and Rust, and reviews related literature and practical work. As its primary contribution it presents a case study of the geometry API of my software renderer library, Retrofire, which is more strongly typed than almost all similar APIs while striving for good developer experience and minimal time or space overhead.
Abstract:
This thesis investigates the use of type-level techniques for reducing programming errors in 3D graphics programming, in particular as relates to the representation of geometry and coordinate transformations. Existing theoretical and practical work on the subject is fairly scarce, and a review of several popular 3D programming APIs reveals that none attempt to alleviate or prevent such errors either at runtime or compile time.
A case study of Retrofire, a software 3D rendering library written in the Rust programming language, is presented. Retrofire employs generic types (parametric polymorphism), traits (type classes), and tag (phantom) types to rule out many of the identified programming errors at compile time, with a goal of minimal or zero impact on runtime performance.
The library is evaluated from the viewpoints of performance and developer experience. The conclusion is that the API is useful and helps prevent bugs in real-world programming, but more experience in writing complex applications with Retrofire is required for deeper understanding of its ergonomics. The library also appears to attain its goal of minimal performance overhead compared to a more conventional API; questions requiring further study include optimal memory management and use of SIMD vector operations.
2 posts - 2 participants
🏷️ Rust_feed