Type-safe(r) model of geometry in 3D graphics
976.85 KB
avoin
Julkaisu on tekijänoikeussäännösten alainen. Teosta voi lukea ja tulostaa henkilökohtaista käyttöä varten. Käyttö kaupallisiin tarkoituksiin on kielletty.
Lataukset17
Pysyvä osoite
Verkkojulkaisu
DOI
Tiivistelmä
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.