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

There's plenty you can do with D but not C++, see regex, bitfields, swap member-by-member with checks for mutual pointers, the pegged library for grammars, etc etc.


I don't know, Boost has me convinced that even things like regexes in C++ templates could be possible, if your compiler has a big enough stack to handle very deep template recursions. It's theoretically possible to build a regex parser in C++ templates, right? It would be horrible, but possible.


With D it is possible and not horrible and already done. ;)

Talk: http://dconf.org/2014/talks/olshansky.html


> It's theoretically possible to build a regex parser in C++ templates, right?

You'd probably do large portions of it in "constexpr" types and functions rather than relying on recursive metaprogramming techniques.

They are also planning on adding overloading based on whether a function is constexpr, which is important if you want the same library to support both compile-time and run-time matchers.

So it's all theoretically possible already. But D has the advantage here in that it's not just possible but usable.




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

Search: