
On Sun, Oct 18, 2009 at 12:09 PM, Christopher Jefferson <chris@bubblescope.net> wrote:
On 18 Oct 2009, at 18:56, Vladimir Prus wrote:
Christopher Jefferson wrote:
On 18 Oct 2009, at 18:14, Hartmut Kaiser wrote:
I agree with everything except Sebastians notion the preprocessor was not Turing complete, because it is (this has been shown in the past). But that's just a minor detail.
Are you sure? I'm sure it's not. Template instansiation certainly is, but I'm sure the preprocessor isn't, due to the lack of recursion or backtracking.
See here: http://tinyurl.com/yj6crup
While that is a very impressive piece of coding, it doesn't show NP- completeness of the preprocessor,
Did you mean "Turing-complete"?
Yes, sorry. And also sorry how far we are drifting off topic.
One thing that lambda code does show to me is that there are some in principle fairly simple extensions which could be made to the C preprocessor which would make it much more useful, while keeping it's current approach of being unaware of the underlying language. Has anyone ever investigated how they might write a "better preprocessor", which mght simplify or remove much of the nastier parts of the preprocessor hacks in boost?
Hence why I mentioned D templates. You could probably hack something like that into Clang, along with D mixins (all compatible with C++ syntax), that gives you just about all the power anyone could ever want for C++, in a vastly easier to use way then is current.