4 ms·
If you—like me—were interested in Diesel ORM's zero sized types thing, here's a pretty decent explanation: https://np.reddit.com/r/rust/comments/3ur9co/announci
by barsonme 9y ago
If you—like me—were interested in Diesel ORM's zero sized types thing, here's a pretty decent explanation: https://np.reddit.com/r/rust/comments/3ur9co/announcing_diesel_a_safe_extensible_orm_and_query/cxi143z/ https://np.reddit.com/r/rust/comments/3ur9co/announcing_dies...
edit: Go also has zero-sized types (struct{}), so I wonder if this is also possible? Probably not, I don't think, since the compiler doesn't see through interfaces.
- Manishearth 9y agoIf you're interested in more of this, Sean, the author of Diesel, is giving a talk @ RustConf in August (http://rustconf.com/program.html#sean http://rustconf.com/program.html#sean) which will probably cover these tricks in more depth :) [Talks will be recorded, but also tickets are on sale right now if you want to be there in person!]
- tatterdemalion 9y ago> Go also has zero-sized types (struct{}), so I wonder if this is also possible? No. It specifically uses Rust's generics system, and the fact that generics are monomorphized at compile time, whereas Go interfaces are not. C++ templates can be used in similar ways.