News for hackers. Stuff that matters.
Re:Rust and the Blub Paradox by mst on Saturday January 23, 2016 @01:55PM (#10959487)
Is that mostly a faster feedback loop and better errors thing? It seems like so long as the generated code doesn't get as far as compiling, it doesn't make that much of a difference?

(this could easily be a stupid question; I know I've come across as condescending to you before by mistake and if I've somehow done it again please believe that I meant to come across as genuinely curious :)

Re:Rust and the Blub Paradox by pcwalton on Saturday January 23, 2016 @02:02PM (#10959520)
There are a number of benefits to concepts:

- They make namespacing of functions easier, eliminating the need for C++'s "argument-dependent lookup". The issues here are somewhat subtle and would take a lot of space to explain. But the end result is that we can remove a massive amount of confusion by getting rid of ADL.

- Error messages are much better, because the insides of templates never leak to users of the template.

- Typechecking is simplified, because we only have to typecheck each template once, at the time of definition, as opposed to repeatedly typechecking it from scratch every time it's instantiated. This, in theory, allows compilation to be faster.

Re:Rust and the Blub Paradox by mst on Saturday January 23, 2016 @04:23PM (#10960161)
> Error messages are much better, because the insides of templates never leak to users of the template

This is unequivocally a good thing - I think maybe my disconnect here in how excited I am compared to others is that I'm comparing it to the experience of debugging lisp macros and everybody else is comparing it to the bottomless pit of despair that is C++ template errors ;)

Re:Rust and the Blub Paradox by steveklabnik on Saturday January 23, 2016 @02:00PM (#10959510)
Not at all!

Yes, to me, it's largely about better errors and such. If th generated code is wrong, it won't compile, so it's not _that_ level of bad. But this can't happen in Rust: http://tgceec.tumblr.com/

Re:Rust and the Blub Paradox by mst on Saturday January 23, 2016 @04:21PM (#10960146)
Now I want to see an article that compares the error messages from rust and D metaprogramming ... though admittedly, at least half of this is because you could call said article "D missed nosejob day".
Re:Rust and the Blub Paradox by Manishearth on Sunday January 24, 2016 @04:00AM (#10961992)
Note that with bounded polymorphism you get clear API boundaries too. With templates you may have to clearly document what kind of type is allowed in.

There's also the danger of something compiling where it shouldn't.