> what i've really been wondering about for a while is
> whether there are any considerations of static / compile-time introspection,
> and if not, why.
> It's nothing pressing, i'm just really curious and i haven't found anything
> on it (besides the rare musings of other C++ users on this).
> 
> Basically static introspection would allow meta-programming to take it a step
> further; e.g. to use template-meta-programming to iterate at compile-time
> through information about members of namespaces and classes. You would be
> able to get their signatures/addresses/names/attributes/... and generate
> code for them.
> Use-cases would e.g. be:
> * generation of bridging code (C++ ↔ script)
> * various wrapper scenarios (forward/filter/... interfaces)
> * runtime reflection for select code subsets
> … for which currently separate pre-build steps (e.g. Qts moc), pre-processor
> markup (say Boost Reflect), repetitive code etc. are necessary - so it's
> either crude or requires specific toolchains.

This is definitely an active area of investigation in the Committee.

There is a Reflection Study Group (a sub-group of the Committee which
focuses on a particular area) which is tasked with investigating 
language and library extensions for compile-time and runtime reflection.
The majority of the interest so far has been for compile-time reflection,
but I believe some of the infrastructure for compile-time reflection
will enable runtime reflection as well.

The Reflection Study Group met in Chicago last week, and talked about
a rough outline of the sorts of things C++ programmers would like to 
be able to do with reflection, from straightforward things like 
iterating over the members of a class at compile-time for purposes 
such as serialization and equality comparison, to more sophisticated 
things like synthesizing new types by transforming existing types. 

I believe the plan is to issue a call for proposals, with some 
guidance about the general direction that is desired, derived from 
that outline. The Study Group will then look at the proposals at 
future meetings and provide feedback, with the aim of converging
towards a cohesive set of proposals to present to the Committee at
large.

Since this is a very broad area to explore, I believe the Study 
Group is initially interested particularly in proposals that 
provide infrastructure that compile-time reflection features can 
be built on top of. This should become more clear when the
call for proposals is issued.

Botond
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to