4 ms·
But C++ is not a sane language because templates are Turing-complete, right?
by meindnoch 2y ago
But C++ is not a sane language because templates are Turing-complete, right?
- danschuller 2y agoC++ 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.
- sham1 2y agoTo 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.
- pjmlp 2y agoC++ 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.
- ramon156 2y agoC++ 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.
- pjmlp 2y agoThere are C++ template debugging tools in IDEs.
- keybored 2y agoThere’s Turing Complete and Turing Tarpit.[1] [1] Which one is the Rust macro system? I have no idea.