473,386 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Toward an Introspection Open Standard

Has there been any substantial progress toward supporting
introspection/reflection in C++?

I don't intend to mean it should be part of the Standard. It would,
nonetheless, be nice to have a generally accepted means of providing
introspection.

My inclination is to have two general categories of introspection: dynamic
introspection, and static intospection. In situations where it makes sense
to use virtual functions and their associated vtbls, introspection would
probably be easier to provide and used. We could inherit from a common
base class (beware the diamond DAG). In situations where the overhead of
virtual function pointers is of significant consequence (highspeed
scientific and engineering programs) it may be possible to provide a means
of introspection similar to the way concepts are supported and used with
templates.

Ideas?
--
"If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true." - Bertrand
Russell

Jul 22 '05 #1
4 1797

"Steven T. Hatton" <su******@setidava.kushan.aa> wrote in message:
Has there been any substantial progress toward supporting
introspection/reflection in C++?

I don't intend to mean it should be part of the Standard. It would,
nonetheless, be nice to have a generally accepted means of providing
introspection.


I think there's strong interest in adding (more) compile-time and runtime
reflection to C++. Bjarne Stroustrup specifically mentioned compile-time
reflection as an area of keen interest at the recent standards committee
meeting.

The problem is that C++ is a very complicated language, and so any adequate
reflection facility will also be very complicated-- much more complicated, e.g.,
than reflection in Java. People need to write proposals which are detailed
enough so that they can be sensibly evaluated. The proposals will then be
heavily criticized and need to be revised. If this process happens four or five
times, maybe a reflection facility will make it into the next standard.

Why don't you start by sketching some concrete proposals?

Jonathan
Jul 22 '05 #2
Jonathan Turkanis wrote:
I think there's strong interest in adding (more) compile-time and runtime
reflection to C++. Bjarne Stroustrup specifically mentioned compile-time
reflection as an area of keen interest at the recent standards committee
meeting.

The problem is that C++ is a very complicated language, and so any adequate
reflection facility will also be very complicated-- much more complicated, e.g.,
than reflection in Java. People need to write proposals which are detailed
enough so that they can be sensibly evaluated. The proposals will then be
heavily criticized and need to be revised. If this process happens four or five
times, maybe a reflection facility will make it into the next standard.

Why don't you start by sketching some concrete proposals?


I do not know if you have the same thing in mind when using the term
reflection, however C++/CLI provides reflection support with the use of
attributes.

Attributes is a way to extend the language in a custom way.

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 22 '05 #3
Jonathan Turkanis wrote:
I think there's strong interest in adding (more) compile-time and runtime
reflection to C++. Bjarne Stroustrup specifically mentioned compile-time
reflection as an area of keen interest at the recent standards committee
meeting.

The problem is that C++ is a very complicated language, and so any adequate
reflection facility will also be very complicated-- much more complicated, e.g.,
than reflection in Java. People need to write proposals which are detailed
enough so that they can be sensibly evaluated. The proposals will then be
heavily criticized and need to be revised. If this process happens four or five
times, maybe a reflection facility will make it into the next standard.


I know Bjarne (with Gaby Dos Reis) is actively working on an
implementation for type reflection and much more, including the ability to
represent a C++ program as a manipulatable structure. Cool stuff. That
project is called XTI, which IIRC stands for eXtensible Type Information.
XTI has been under development for several years, and I hear it's getting
close to a state where it can be used and presented. I won't say more
about it, in part because I don't know more about it :-), and in part
because the details are Bjarne's and Gaby's news to release when they're
ready.

Herb

---
Herb Sutter (www.gotw.ca) (www.pluralsight.com/blogs/hsutter)

Convener, ISO WG21 (C++ standards committee) (www.gotw.ca/iso)
Contributing editor, C/C++ Users Journal (www.gotw.ca/cuj)
Architect, Developer Division, Microsoft (www.gotw.ca/microsoft)
Jul 22 '05 #4

"Herb Sutter" <hs*****@gotw.ca> wrote in message
news:ei********************************@4ax.com...
Jonathan Turkanis wrote:
I think there's strong interest in adding (more) compile-time and runtime
reflection to C++. Bjarne Stroustrup specifically mentioned compile-time
reflection as an area of keen interest at the recent standards committee
meeting.

The problem is that C++ is a very complicated language, and so any adequate
reflection facility will also be very complicated-- much more complicated, e.g., than reflection in Java. People need to write proposals which are detailed
enough so that they can be sensibly evaluated. The proposals will then be
heavily criticized and need to be revised. If this process happens four or five times, maybe a reflection facility will make it into the next standard.
I know Bjarne (with Gaby Dos Reis) is actively working on an
implementation for type reflection and much more, including the ability to
represent a C++ program as a manipulatable structure. Cool stuff. That
project is called XTI, which IIRC stands for eXtensible Type Information.
XTI has been under development for several years, and I hear it's getting
close to a state where it can be used and presented. I won't say more
about it, in part because I don't know more about it :-), and in part
because the details are Bjarne's and Gaby's news to release when they're
ready.


Yes, I've heard of this project, and I'm eager to know what it will look like.
My impression was that not much work had been done on it recently, but I am
happy to hear otherwise.
Herb


Jonathan
Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: daniel narf | last post by:
Hi i am sure most of you have read the article of Andrew Kuchling about focusing more in the standart library than language newFeatures/tweaking and probably i as many others would like to know...
6
by: Steven Bethard | last post by:
So I thought I'd try to summarize a few things here and maybe we can move toward filing a PEP. I'm not really sure I'm the right person to champion it because, as I've mentioned, I usually...
4
by: Benjamin Rutt | last post by:
I'm trying to learn about introspection in Python. my ultimate goal is to be able to build a module "text database" of all modules that are in the sys.path, by discovering all candidate modules...
1
by: James Geurts | last post by:
Hi, Can someone tell me how to test if a field is a const? I am using the FxCop introspection engine, but I suppose I could use reflection if required. for example, the following would return...
2
by: greg.corson | last post by:
Hi, I'm in the process of building a complex system using a sort of "system services" model. I'm looking at putting together various services like serialization, networking, 2D/3D rendering,...
8
by: R. Bernstein | last post by:
In doing the extension to the python debugger which I have here: http://sourceforge.net/project/showfiles.php?group_id=61395&package_id=175827 I came across one little thing that it would be nice...
3
by: James Stroud | last post by:
Hello, I wanted to automagically generate an instance of a class from a dictionary--which might be generated from yaml or json. I came up with this: # automagical constructor def...
14
by: Dave Rahardja | last post by:
Is there a way to generate a series of statements based on the data members of a structure at compile time? I have a function that reverses the endianness of any data structure: /// Reverse...
9
by: Ken Fine | last post by:
Hi there, I have written a simple function that attempts to set the angle of objects so as to place them in aesthetically appealing ways. The code follows; there is some stupidness in it (e.g. a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.