[cfe-dev] Reflection/metaparsing implem
Andrew Sutton via cfe-dev
cfe-dev at lists.llvm.org
Mon Nov 11 14:04:51 PST 2019
> The current WG21 standardization process puts the cart before the horse — they have a Reflection subgroup attempting to design a standard reflection facility prior to any vendor implementation experience and without any body of existing practice (motivation) to guide their design.
This is wildly inaccurate.
SG7 has been discussing static reflection systems for at least 5
years. There is well-established motivation on top of decades of
practical experience including template metaprogramming and languages
with dynamic reflection.
As far as implementation experience goes, quoting P1240R1:
"Two implementations of this proposal are underway. The first and most
mature/complete is a fork of Clang by Lock3 Software (by, among
others, Andrew and Wyatt, authors of this paper). It includes a large
portion of the capabilities presented here, albeit not always with the
exact syntax or interfaces proposed. The second is based on the EDG
front end (by Faisal and Daveed) and is in very early stages, which
just a few cases of the reflexpr operator, a few reifiers, and a few
meta-library interfaces implemented"
There was a prototype of the template-based approach by Matus. That
probably goes back 4 years. The first work on the Clang version
(https://gitlab.com/lock3/clang) started more than 3 years ago. I
know... I wrote it. I also gave talks on this work at CppCon in 2017
and 2019. Herb Sutter has given a number of talks about this since at
least 2017 (usually related to metaclasses). We've had active
experimenters for quite a while.
None of this work has been secret. It's well documented. This
information is easy to find, the people involved even more so. Any
claims that SG7 isn't working hard on this feature is either ignorant
or an aspersion.
More information about the cfe-dev