3 ms·
Could you give an example? To me (I’m not a C++ programmer), “elaborate function dispatch hierarchies” sound like complexity that should be avoided.
by pansa2 6y ago
Could you give an example? To me (I’m not a C++ programmer), “elaborate function dispatch hierarchies” sound like complexity that should be avoided.
- CyberRabbi 6y agoOh not complex at all. This is a boon for programming computations for GA (geometric algebra). There are libraries that automatically generate algebras and operations within those algebras (such a versor: http://versor.mat.ucsb.edu/ http://versor.mat.ucsb.edu/), and then you can operate on user-defined versors naturally. It actually makes things less complex because you don’t need to remember a million function names. This is one of the special cases where templates and advanced function dispatch enable super powers. 100% optimal code, type-safe, user-defined, expressive, and automatically generated. Watch your compile times though
- dan00 6y ago> Watch your compile times though And your error messages. ;)
- simiones 6y agoboost::spirit and boost::qi are similar uses of deep secrets of template magic. They work nicely, until you make your first minor error and have to understand the whole machinery to get what's wrong. Maybe someday we'll have a language that is efficient and also allows creating efficient and usable DSLs. C++ ain't it. Edit: perhaps D would actually be that language?
- CyberRabbi 6y ago> Maybe someday we'll have a language that is efficient and also allows creating efficient and usable DSLs. C++ ain't it. C++ constraints change the game here. Esoteric template errors will be a thing of the past
- simiones 6y agoAssuming you're talking about Concepts, I've heard Andrei Alexandrescu, for example, challenge that hope [0], but I'd be happy to hear this has been fixed. [0] https://www.youtube.com/watch?v=AxnotgLql0k https://www.youtube.com/watch?v=AxnotgLql0k