3 ms·
Thing<A<B, C<D>, E>> except for a different bracket syntax, it is the type level equivalent of: Thing(A(B, C(D)), E) There absolutely nothing unreadable w
by gpderetta 7y ago
Thing<A<B, C<D>, E>>
except for a different bracket syntax, it is the type level equivalent of:
Thing(A(B, C(D)), E)
There absolutely nothing unreadable with that. Mind you, I find <> brackets somewhat ugly, but that's subjective and plenty of languages have made the same choice.
To be more constructive, C++ templates have two major pain points: template specialization means that the template machinery is a full term rewriting engine, so arbitrary computations can be expressed in it. The other issue is that it is hard to specify template constraints (or concepts, it type classes or traits or whatever term you prefer).
A new language can eskew specialization (but note that Rust, that wants to compete in the same space as C++ has added, or is adding them), and there is no good reason not to have constraints in a new language (the design space is well explored).
- GeertJohan 7y agoI think you misplaced a ) there. Thing<A<B, C<D>, E>> Is the type level equivalent of: Thing(A(B, C(D), E)) Not: Thing(A(B, C(D)), E) I guess this is illustrative for how it is unreadable.
- gpderetta 7y agoIt is more illustrative that it is inconvenient to type in the HN commento box from mobile.