Rant after trying Rust a bit

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Sat Jul 25 21:14:13 PDT 2015


On Sunday, 26 July 2015 at 01:56:29 UTC, Tofu Ninja wrote:
> Key point is opt-in.

Opt-in doesn't really fix the problem. It just allows you to 
choose whether you're going to break more code by requiring that 
all template constraints be updated because a function being 
called inside somewhere had its constraint updated. So, you're 
choosing whether to opt-in to that problem or not, but if you 
opt-in, you're still screwed by it. That's not going to change 
just because it's optional.

And my point about template constraint condition proliferation 
holds even with the current implementation. Anyone choosing to 
try and put all of the sub-constraints in the top-level 
constraint has a maintenance problem. Sure, you can choose not to 
do that and let the user see errors from within the template when 
they use a type that fails the template constraint of a function 
being called and thus avoid the constraint proliferation (which 
then causes its own problems due to how that's more annoying to 
deal with when you run into it), but the problem is still there. 
If you opt-in to putting everything in the top-level template 
constraints, you will have a maintenance issue.

The fact that you can choose what you do or don't put in your 
template constraints (or  that you could choose whether to use 
the new paradigm/feature that you're proposing) doesn't fix the 
problem that going that route causes maintenance issues. That 
fundamental problem still remains. All it means is that you can 
choose whether you want to cause yourself problems by going that 
route, not that they're necessarily a good idea.

- Jonathan M Davis


More information about the Digitalmars-d mailing list