Which IDL specification? IDL is not homogenous, it just stands for
Interface Definition (or Description) Language. The Queens University
IDL has colonized the acronym, but there are any number of IDL's. ALL
IDL's I have encountered DO provide link guarantees.
I meant the OMG IDL. It looks as though the common theme of IDL programming
is to create the interface declaration in the interface language, and then
"compile" it to create stubs for the implementation. Most of what I've
seen has to do with the creation of client/server relationships of some
kind. But I don't claim to be an expert (yet).
I will say this. google for distributed computing IDL, and see what
proportion of the hits deal with C++. I know that is not a perfect metric,
but it's an indicator.
You can write (almost) anything in (almost) any language, so
technically you are correct, however you are making it very difficult
for yourself.
I'm not sure what I'm making difficult for myself. If you are suggesting
that I use existing technology rather than reimplement the wheel, I
probably will use the best existing technology (as I currently am). Part
of the reason I started this thread is because I want to investigate the
existing capabilities and limitations of C++. If existing capabilities are
revealed, then we can use them. If limitations are exposed, perhaps they
can be addressed by modifications to the Standard. I actually have a
thread going on comp.std.c++ regarding the topic of interfaces.
Please do not trivialize link compatibility betwen
languages and compilers, it is an enormous undertaking to make
languages using various compilers (and possibly VM's) on various
platforms to communicate with each other.
JJJ
I'm not completely sure of what you mean. There are two distinct concepts
we seem to be dealing with. One has to do with the interface through which
an object (module, component, service, etc.) is accessed. The other is how
this communication is achieved. It is the former which I am specifically
interested in. The latter is of relevance in so much as it impacts and
constrains the former. I guess your point is the IDL provides a "contract"
language for formalizing how different components interact. Mind you, my
focus in asking this question was not on language neutrality. It was
specifically directed toward C++.
But to follow your tangent, suppose I took things from a different
direction. Suppose I specified a convention for declaring an interface in
C++, based on Stroustrup's notion of a pure interface (see below). Could
that be used as an IDL capable of being "compiled" by, say, a tool to
produce Java stubs?
These are a few items I came across while looking into this matter:
This one's just a gratuitous random jab.
"COM uses the word interface in a sense different from that typically used
in Visual C++ programming. A C++ interface refers to all of the functions
that a class supports and that clients of an object can call to interact
with it. A COM interface refers to a predefined group of related functions
that a COM class implements, but a specific interface does not necessarily
represent all the functions that the class supports. (Java programmers will
find themselves at home with COM interfaces because Java defines interfaces
in just the same way.)" - MSDN "COM Objects and Interfaces"
XPCOM Part 1: An introduction to XPCOM
http://www-128.ibm.com/developerworks/webservices/library/co-xpcom.html
"abstract class - a class defining an interface only; used as a base class.
Declaring a member function pure virtual makes its class abstract and
prevents creation of objects of the abstract class. Use of abstract classes
is one of the most effective ways of minimizing the impact of changes in a
C++ program and for minimizing compilation time. Example. TC++PL 2.5.4,
12.4.2, D&E 13.2." - BS
"interface - a set of declarations that defines how a part of a program can
be accessed. The public members and the friends of a class defines that
class' interface for other code to use. A class without data members
defines a pure interface. The protected members provide an additional
interface for use by members of derived classes. See also: abstract class."
- BS