Boost logo

Boost :

From: Prabhu Ramachandran (prabhu_at_[hidden])
Date: 2000-10-10 13:50:40


hi,

        Before I start anything else I'd like you to know that I am
not a Computer scientist by profession. I use c++ and python for my
research and recreation. Please bear with any errors/absurdities in
what follows.

        I have been looking at tools that help use c++/c libraries via
other programming languages. For a list of such software you can look
here:
http://swig.sourceforge.net
and here:
http://swig.sourceforge.net/links.html

        There are quite a few tools that try to do c++ -> other
language wrapping (I dont know if this is the right term). All of
them seem to share a lot of common features. As is obvious, most of
them do very similar things. Each with its own limitations quirks
etc. After a cursory glance, one tool seems to stand out - ILU (Inter
Language Unification)

ftp://parcftp.parc.xerox.com/pub/ilu/ilu.html

it even has the right name. :) But it seems to be designed along the
lines of CORBA, maybe it is vice versa, whatever...

It seems to abstract out an interface that can be used for a large set
of languages. This seems the right way to do things. I havent looked
at ILU in great detail but the points I want to make are related to
generic library wrapping and are as follows.

(1) It doesnt make sense for each wrapper creator to hack at her/his
version of the parser etc. and redo work. It is even worse if each
library requires new wrapper code. Tools like swig ease this process
but not by much. swig is not completely c++ compliant and doesnt
support a large number of important c++ constructs like function
overloading and templated class support. Swig works ok for C
libraries. It is a step towards an inter langage library use but
suffers from the lack of abstraction to a common interface language.

(2) By specifying a Univeral Language/Interface (henceforth called UL)
and providing wrappers from a specific language -> UL and also from UL
-> specific language one saves a huge amount of time and pain.

        (a) Take for instance the case of the GTK library. GTK is
        written in C but there are all kinds of languages that are
        currently supported. Each of these ports would have taken a
        quite a lot of work. If the developers had concentrated on a
        UL to specific language wrapper then their efforts would
        become completely general and it would be possible to wrap
        *any* other library to this particular language.

        (b) Even if some wrappers are partial it still prevents a ton
        of replicated work.

        (c) I guess this is beginning to sound like CORBA but I hope
        you folks get the drift of what I mean.

I have no idea if this is possible with ILU. But it sure seems to
make sense to add an abstraction layer between languages. I admit
this is a non-trivial task but well worth it in the long run.
Projects like ILU show that something along these lines is possible.

I cant even begin to think how useful a generic tool like this would
be to the software community. There are a ton of libraries out there
if inter language wrapping was generalized it would be truly amazing.

I am sure others have thought of this before. I just wanted to run
this idea by you folks.

prabhu


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk