Re:Proving that C++'s grammar is undecidable
by tines on Wednesday April 29, 2020 @02:08PM
(#23022260)
Yes. From what I understand, Rust's macros/generics are not Turing complete.
[ Parent
| on HN ]
Re:Proving that C++'s grammar is undecidable
by steveklabnik on Wednesday April 29, 2020 @04:29PM
(#23023866)
They are. Procedural macros especially are a function that takes tokens and returns tokens, and have the full language at their disposal.
Re:Proving that C++'s grammar is undecidable
by tines on Thursday April 30, 2020 @11:43AM
(#23032092)
Ah interesting. But I imagine that token-based macros don't give you access to the types in the program being compiled do they? i.e. a c++ template can tell when two types are the same but a token level macro wouldn't be able to do that I think.
Re:Proving that C++'s grammar is undecidable
by steveklabnik on Thursday April 30, 2020 @11:45AM
(#23032113)
Correct.