From: David Abrahams (dave_at_[hidden])
Date: 2005-05-09 08:19:56
"Andrei Alexandrescu (See Website For Email)" <SeeWebsiteForEmail_at_[hidden]> writes:
> This is, unsurprisingly, a major effort, and boost would be a
> crucible of the size and expertise needed to pull it off.
I think solving the "syntactic metaprogramming problem" really
requires familiarity with and access to the source code of a C++
compiler. I don't think we have much of that around here, despite the
existence of g++.
> The way I see things, there are three ways:
> 1. Start from the Boost implementation of the C++ preprocessor, and
> add sane features to it. Keep the old preprocessor features as
That one's a possibility. I personally would not want to solve these
problems in the preprocessor layer because I want better integration
with the rest of the language than that approach can offer. Others
may feel differently, of course.
> 2. Agree on a standard text preprocessing tool (perl, awk, sed, m4...)
> and write some utilities tailored for C++ tasks.
I've gone down this path, with unsatisfactory results. Not interested
in this one.
> 3. Start an effort to add ways of manipulating ASTs to the native
> language so as to eliminate the need for preprocessing.
That approach has promise. Bjarne has a project to standardize a C++
program representation and manipulation library -- it could be
interesting to build a metaprogramming system around that.
> Given, however, the lack of traction that I sense around here, I
> think this group will be flooded with arguments on why all of 1, 2,
> and 3 are disadvantageous.
Wow, I guess nobody would want to argue with you on any points for
fear of being part of the flood and confirming your "lack of
traction." I think until this post of mine showed up, this last
sentence had the effect of quashing any further discussion of your
three ideas. Instead we have a mostly-irrelevant thread about whether
TMP and PPMP are similar.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk