Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Oh 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/), 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


boost::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?


> 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


Assuming 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


> Watch your compile times though

And your error messages. ;)




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: