News for hackers. Stuff that matters.
Re:Rust: “Explain GATs Like I'm 5 Years Old” by titzer on Monday November 07, 2022 @09:47AM (#33506433)
As with anything, it all goes well until it doesn't. When you have a single bug (e.g. type error or dynamic error), the guts of whatever is in the box spill out. Case in point: all the implicit template parameters to std:: in C++ these days. The only way to add configuration options in a backwards-compatible way was to add default values for template arguments. That's all fine and good when you can't see them, but as soon as you have a nasty type error, the types that come spilling out in error messages have zillions of default arguments that get printed.

It's almost always the same with inference. I would be very, very wary of doing so much type sophistry that it requires heavy inference to be usable.

There are no comments on this comment yet.