Baby Steps
As some of you may know, on May 4th Jack Huey opened a PR to stabilize an initial version of generic associated types. The current version is at best an MVP: the compiler support is limited, resulting in unnecessary errors, and the syntax is limited, making code that uses GATs much more verbose than I’d like. Nonetheless, I’m super excited, since GATs unlock a lot of interesting use cases, and we can continue to smooth out the rough edges over time. However, folks on the thread have raised some strong concerns about GAT stabilization, including asking whether GATs are worth including in the language at all. The fear is that they make Rust the language too complex, and that it would be better to just use them as an internal building block for other, more accessible features (like async functions and [return position impl trait in traits][RPITIT]). In response to this concern, a number of people have posted about how they are using GATs. I recently took some time to deep dive into these
Many modes: a GATs pattern · baby steps As some of you may know, on May 4th Jack Huey opened a PR to stabilize an initial version of generic associated types . The current version is at best an MVP: the compiler support is limited, resulting in unnecessary errors, and the syntax is limited, making code that uses GATs much more verbose than I'd like. Nonetheless, I'm super excited, since GATs unlock a lot of interesting use cases, and we can continue to smooth out the rough edges over time. However, folks on the thread have raised some strong concerns about GAT stabilization , including asking
Explore this link on the map →related reading
- The Better Alternative to Lifetime GATs - Sabrina Jewsonsabrinajewson.org
- A half-hour to learn Rustfasterthanli.me
- Defining Shared Behavior with Traits - The Rust Programming Languagedoc.rust-lang.org
- GPT-4openai.com
- Gwern visits BAIR – Yuxi on the Wiredyuxi.ml
- Rust Language Cheat Sheetcheats.rs
- Generic Types, Traits, and Lifetimes - The Rust Programming Languagedoc.rust-lang.org
- Leaving Haskell behind - Infinite Negative Utilityjournal.infinitenegativeutility.com
- adventures in uncertainty: An Introduction to Recursion Schemesblog.sumtypeofway.com
- Generic Data Types - The Rust Programming Languagedoc.rust-lang.org
- Reading 19: Little Languagesweb.mit.edu
- di.ku.dk/english/research/phd/phd-theses/2025/dissertation_Robert.pdfdi.ku.dk