News for hackers. Stuff that matters.
Re:Rust: “Explain GATs Like I'm 5 Years Old” by gpderetta on Monday November 07, 2022 @08:53AM (#33505755)
Aren't GATs equivalent to nested template classes? I.e. they are really orthogonal to concepts.
Re:Rust: “Explain GATs Like I'm 5 Years Old” by pjmlp on Monday November 07, 2022 @10:03AM (#33506677)
Might be a bit of job deformation, knowing C++ since 1993, and I still need to get myself used to those patterns.

Maybe I should delve again into GADTs in OCaml, before having a second look.

Re:Rust: “Explain GATs Like I'm 5 Years Old” by Rusky on Monday November 07, 2022 @11:18AM (#33507818)
GATs are completely unrelated to GADTs.
Re:Rust: “Explain GATs Like I'm 5 Years Old” by pjmlp on Monday November 07, 2022 @12:52PM (#33509387)
From my point of view they look quite similar from language type theory point of view, plus the machinery for affine types.
Re:Rust: “Explain GATs Like I'm 5 Years Old” by Rusky on Monday November 07, 2022 @01:07PM (#33509608)
The only thing similar about them is the acronym:

GATs are generic type aliases which are defined inside traits.

GADTs are generic sum types with extra constraints on which variants may be used with which type arguments.

There is no reasonable way in which they are "quite similar," nor do either of them have anything at all to do with affine types.

Re:Rust: “Explain GATs Like I'm 5 Years Old” by pjmlp on Monday November 07, 2022 @02:07PM (#33510689)
Where is the type theory for Rust's GATs for us to educate ourselves?
Re:Rust: “Explain GATs Like I'm 5 Years Old” by Rusky on Monday November 07, 2022 @02:37PM (#33511168)
Re:Rust: “Explain GATs Like I'm 5 Years Old” by pjmlp on Tuesday November 08, 2022 @09:19AM (#33519192)
Thanks.