Hacker News new | ask | show | jobs
by meindnoch 638 days ago
But C++ is not a sane language because templates are Turing-complete, right?
3 comments

C++ is not a sane language for anyone with a passing familiarity. At least Rusts macros aren't literal text substitutions, a move towards the light.
To be fair, neither are C preprocessor macros. They're instead token substitutions. It's not that much better, but they're not literally text substitution. They're at least more clever than just that.

They're also of course surprisingly powerful, at the expense of being very cludgy.

C++ templates, coupled with compile time programming, and eventually static reflection, make it easier than the multiple macro languages from Rust, with the additional dependency on syn crate.
There’s Turing Complete and Turing Tarpit.[1]

[1] Which one is the Rust macro system? I have no idea.

C++ templates are a hell to develop with, at least macro_expand is a thing in Rust. It's the fact Rust's tooling is so well done.
There are C++ template debugging tools in IDEs.