[ANN] Interfaces Library

I am pleased to announce the much anticipated (by me) release of a preliminary version of my interfaces library. The download page and online docs are here: http://www.kangaroologic.com/interfaces/ (For fun, click on "Online Documentation" and then on the Boost logo.) The library is an implementation of Christopher Diggins's proposal to add interfaces to C++, which was posted on comp.std.c++ early last year and later was described in the C/C++ User Journal. It provides a macro-based Interface Definition Language (IDL) which can be used to define C++ class types called interfaces. An interface is a lightweight value type associated with a set of named function signatures. An interface instance can be bound at runtime to any object which implements the interface, i.e., to any object of a type with accessible non-static member functions having the same name and signature as the set of functions associated with the interface. The functions of the bound object can then be invoked through the interface instance using the "dot" operator. Binding is completely non-intrusive: the object's type need not declare any virtual functions or derive from any particular base class. Current applications include: * Non-intrusive dynamic polymorphism - interfaces can often be used in place of abstract base classes, and are sometimes much faster. * Dynamic inheritance - allows function calls to be forwarded automatically to an object specified at runtime. * Smart Interface Pointers - smart pointers which can manage the lifetime of any object whose type implements a given interface. * Smart References - like smart interface pointers, but the managed object is accessed using the dot operator. * The Object Oriented Template Library, a project in the initial stages of development, by Christopher Diggins. Planned future applications include: * Runtime reflection - will allow an interface's functions to be enumerated and looked up by name at runtime * Aspect Oriented Programming as described in a August 2004 Dr. Dobb's Journal article by Christopher Diggins. Possible future applications include: * Integration with component architectures such as COM and CORBA. * Boost.Names - by abstracting the various uses of identifiers in C++ into preprocessor generated types called names, C++ classes and functions can be constructed in a straightforward manner using template metaprogramming. Best Regards, Jonathan

"Jonathan Turkanis" <technews@kangaroologic.com> writes:
I am pleased to announce the much anticipated (by me) release of a preliminary version of my interfaces library. The download page and online docs are here:
http://www.kangaroologic.com/interfaces/
(For fun, click on "Online Documentation" and then on the Boost logo.)
Nice! It would be even nicer if the Bibliography included links to web-archived copies of NG and ML messages cited. -- Dave Abrahams Boost Consulting www.boost-consulting.com

David Abrahams wrote:
"Jonathan Turkanis" <technews@kangaroologic.com> writes:
I am pleased to announce the much anticipated (by me) release of a preliminary version of my interfaces library. The download page and online docs are here:
http://www.kangaroologic.com/interfaces/
(For fun, click on "Online Documentation" and then on the Boost logo.)
Nice!
Thanks!
It would be even nicer if the Bibliography included links to web-archived copies of NG and ML messages cited.
Okay, we had the same conversation regarding MovePtr. The names in brackets in the left column *are* links, but I guess I'll spell them out in the body of the entry to prevent confusion and to make the docs prinatble. Jonathan

David Abrahams wrote:
"Jonathan Turkanis" <technews@kangaroologic.com> writes:
I am pleased to announce the much anticipated (by me) release of a preliminary version of my interfaces library. The download page and online docs are here:
http://www.kangaroologic.com/interfaces/
(For fun, click on "Online Documentation" and then on the Boost logo.)
Nice!
It would be even nicer if the Bibliography included links to web-archived copies of NG and ML messages cited.
Okay, I fixed this in the browsable docs. I remember why I stoped spelling out the links, though. A lot of them go way off the edge, since browsers don't know where to break them. Jonathan

----- Original Message ----- From: "David Abrahams" <dave@boost-consulting.com>
It would be even nicer if the Bibliography included links to web-archived copies of NG and ML messages cited.
The following are the relevant newsgroup discussions I can find concerning the discussions of the interfaces in C++, as implemented by the BIL: comp.lang.object, April 6, 2004 Christopher Diggins: The Failure of OOP http://tinyurl.com/4ot66 comp.lang.c++.moderated, April 6, 2004 Christopher Diggins: Efficient Alternative to MI of virtual functions http://tinyurl.com/6kx56 comp.lang.c++, April 6, 2004 Christopher Diggins: High Performance Alternative to MI of virtual functions http://tinyurl.com/532o3 comp.lang.c++.moderated, April 8, 2004 Christopher Diggins: Interfaces in C++ http://tinyurl.com/5wg4c comp.object, April 8, 2004 Christopher Diggins: Why ABC's make Bad Interfaces http://tinyurl.com/6ftor comp.std.c++ April 9, 2004 Christopher Diggins: Proposal: Interfaces http://tinyurl.com/69w5h comp.std.c++ April 12, 2004 Christopher Diggins : Proposal: Interfaces (rewritten) http://tinyurl.com/4qoa5 comp.std.c++, April 16. 2004 Christopher Diggins: Proposal for Interfaces (Version 3.0) http://tinyurl.com/3khef comp.std.c++, April 25, 2004 David Abrahams: Re: proposal: interfaces [repost] http://tinyurl.com/53tyv comp.std.c++, April 25, 2004 Christopher Diggins: Proposal Version #4 http://tinyurl.com/3hq5z -- IMO some highlights of the discussion were at the following specific posts: comp.object: April 8, 2004 Christopher Diggins, Re: The Failure of OOP http://tinyurl.com/5jmup I believe this is the first time, I eexplicitly mention the "fat pointer" technique and I link to the hfront.zip tool . The original hfront tool and its output is now downloadable from http://www.cdiggins.com/hfront.zip (to see the kind of output generated, look at shapes.hpp) comp.lang.c++, April 16, 2004 Claudio Puviani, Re: feedback on C++ code snippet requested (standards compliance, efficiency, etc) http://tinyurl.com/4q4zh This post by Claudio Puviani inspired my design of the C++ interfaces to not require inheritance. IMO this post deserves special mention. comp.lang.c++, April 16, 2004 Christopher Diggins: Re: feedback on C++ code snippet requested (standards compliance, efficiency, etc) http://tinyurl.com/4fex4 I believe this is the first time I explicitly link to my interfaces code ( http://www.heron-language.com/cpp-iop-example.html ) from a newsgroup posting. comp.std.c++ : April 25, 2004 David Abrahams, Re: proposal: interfaces [repost] http://tinyurl.com/3qmzx This is David Abrahams implementation approach to the interfaces. -- The following web pages may or may not be citable: http://www.heron-language.com/cpp-iop-example.html This is my original proposal for designing C++ interfaces: http://www.heron-language.com/cpp-iop.html The last version of my proposal to add interfaces to C++ (incidentally if anyone feels like reviving this, I am interested in helping out) http://www.heron-language.com/interfaces.html This is a description of interfaces for the Heron programming language http://www.heron-language.com/spec.html#interfaces This is the relevant section of the heron language specification on interfaces. -- My apologies if I missed anything that is considered relevant, Christopher Diggins http://www.cdiggins.com PS Big thanks to Jonathan for putting his heart and soul into this library, and doing such a superlative job.

On 01/25/2005 11:57 PM, Jonathan Turkanis wrote: [snip]
version of my interfaces library. The download page and online docs are here:
[snip]
Current applications include:
* Non-intrusive dynamic polymorphism - interfaces can often be used in place of abstract base classes, and are sometimes much faster. * Dynamic inheritance - allows function calls to be forwarded automatically to an object specified at runtime.
The dynamic inheritance is what would be useful, IMO, for compilers. During different phases of the translation, the nodes in the AST can be "decorated" with different attributes and methods which modify those attributes in a way dependent on attributes in other nodes in the AST. An example of this, used to calculate the first and follow sets of a grammar, is at: http://cvs.sourceforge.net/viewcvs.py/boost-sandbox/boost-sandbox/boost/gram... Would you have the time and inclination to outline the advantages of http://www.kangaroologic.com/interfaces/ vs. that in the sandbox at: http://cvs.sourceforge.net/viewcvs.py/boost-sandbox/boost-sandbox/boost/dyn_... ? Regards, Larry

Larry Evans wrote:
Would you have the time and inclination to outline the advantages of
http://www.kangaroologic.com/interfaces/
vs. that in the sandbox at:
http://cvs.sourceforge.net/viewcvs.py/boost-sandbox/boost-sandbox/boost/dyn_... I will examine your code. At first glance, it looks a little frightening ;-) Jonathan

On 01/26/2005 11:47 AM, Jonathan Turkanis wrote: [snip]
I will examine your code. At first glance, it looks a little frightening ;-)
Yeah, I know. What I was trying to do was create a morphism on data types, where the data types in category C1 are an inheritance heirarchy of some type (e.g. the types representing nodes in an AST), and then create a "mirror" of this in another category C2. However, each class in C2 would dynamically inherit from the corresponding class in C1 AND would also have the same relationships between the types in C2 that are in C1. The diagram in: http://lists.boost.org/MailArchives/boost/msg61156.php may help illustrate. Thanks for any help. Regards, Larry

Jonathan Turkanis wrote:
I am pleased to announce the much anticipated (by me) release of a preliminary version of my interfaces library. The download page and online docs are here:
http://www.kangaroologic.com/interfaces/
(For fun, click on "Online Documentation" and then on the Boost logo.)
That gives the best answer of what the next Boost logo should be ... all of them. Whenever a user first goes to the Boost page, a random one is first displayed, and then when the user clicks on the logo, another one is shown as you have it in your help.

"Edward Diener" <eddielee@tropicsoft.com> writes:
Jonathan Turkanis wrote:
I am pleased to announce the much anticipated (by me) release of a preliminary version of my interfaces library. The download page and online docs are here:
http://www.kangaroologic.com/interfaces/
(For fun, click on "Online Documentation" and then on the Boost logo.)
That gives the best answer of what the next Boost logo should be ... all of them. Whenever a user first goes to the Boost page, a random one is first displayed, and then when the user clicks on the logo, another one is shown as you have it in your help.
It's a fun idea, but it wouldn't serve the main purpose of any logo: providing a sigle, easily-identifiable and memorable symbol for the organization. -- Dave Abrahams Boost Consulting www.boost-consulting.com

On Tue, 25 Jan 2005 23:57:01 -0700, Jonathan Turkanis <technews@kangaroologic.com> wrote:
I am pleased to announce the much anticipated (by me) release of a preliminary version of my interfaces library. The download page and online docs are here:
I'm very pleased to read the announcement and the docs. What an amazing piece of work! I noticed some inconsistencies on this page: http://www.kangaroologic.com/interfaces/libs/interfaces/doc/guide/idl.html under Example III (Template Interfaces). The paragraph says "An interface template name having template arity arity may be defined using the macros BOOST_IDL_BEGIN_TEMPLATE(name, arity) and BOOST_IDL_END_TEMPLATE(name, arity)" but the example code below it uses: BOOST_IDL_BEGIN1(IStack) BOOST_IDL_END1(IStack) There's also an indentation problem with the BOOST_IDL_BEGIN1 line (it is indented and should not be) -- Caleb Epstein caleb dot epstein at gmail dot com

Caleb Epstein wrote:
On Tue, 25 Jan 2005 23:57:01 -0700, Jonathan Turkanis <technews@kangaroologic.com> wrote:
I am pleased to announce the much anticipated (by me) release of a preliminary version of my interfaces library. The download page and online docs are here:
I'm very pleased to read the announcement and the docs. What an amazing piece of work!
Thanks!
I noticed some inconsistencies on this page:
http://www.kangaroologic.com/interfaces/libs/interfaces/doc/guide/idl.html under Example III (Template Interfaces). The paragraph says
"An interface template name having template arity arity may be defined using the macros BOOST_IDL_BEGIN_TEMPLATE(name, arity) and BOOST_IDL_END_TEMPLATE(name, arity)"
but the example code below it uses:
BOOST_IDL_BEGIN1(IStack) BOOST_IDL_END1(IStack)
The sentence you quote continues: "or using the convenience macros BOOST_IDL_BEGINz(name) and BOOST_IDL_ENDz(name), which have the template arity z hard-wired into the macro name" I used the convenience macros in the example code because I think they will be more commonly used. However, I just changed it to give an example of each form.
There's also an indentation problem with the BOOST_IDL_BEGIN1 line (it is indented and should not be)
Thanks. Fixed. Jonathan

On Thu, 27 Jan 2005 12:15:44 -0700, Jonathan Turkanis <technews@kangaroologic.com> wrote:
The sentence you quote continues:
"or using the convenience macros BOOST_IDL_BEGINz(name) and BOOST_IDL_ENDz(name), which have the template arity z hard-wired into the macro name" I used the convenience macros in the example code because I think they will be more commonly used. However, I just changed it to give an example of each form.
Sorry, I read it (and fired off the email) too quickly. -- Caleb Epstein caleb dot epstein at gmail dot com
participants (6)
-
Caleb Epstein
-
christopher diggins
-
David Abrahams
-
Edward Diener
-
Jonathan Turkanis
-
Larry Evans