C bindings for OmniORB?

Philip Dawes philipd@parallax.co.uk
Mon, 12 Jan 1998 09:19:56 +0000


Miguel de Icaza wrote:
> 
> Hello guys,
> 
>    We need a CORBA engine for the gnome project (www.gnome.org, gpl
> user interface stuff) and we are basically shopping for an ORB now.
> We had considered ILU in the past, but due to a license clash with the
> GPL, we can not use it.
> 
>    We need at least C CORBA bindings and at this point none of our
> choices support this (omniorb, mico nor arachne).  So, I am interested
> in adding this support to one of those ORBs, and I would like to know
> how hard this task would be or if anyone is working on such a thing.
> 
>    A possible plan would be to make the C code generation backend
> create C++ code that would export to C, like:
> 
> CORBA_thingie_method (CORBA_object *obj, parameters, CORBA_env *e)
> {
>     thingie *t = (thingie) obj;
> 
>     return t->method (parameters);
> }
> 
> [ie, among those lines, give and take :-)]
> 
>    I dont mind having a C++ support library nor having my stubbers
> using C++ and just presenting the C interface for the bindings.
> 
>    Any ideas on this?
> 
> Miguel.

Hello miguel - fancy seeing you on this list.

I recently asked this question with regards to scripting languages and
got the following reply:

Sai-Lai Lo wrote:
> 
> There is currently no plan to implement other language bindings
> (python,perl,guile,java). IMHO, there are well established free software,
> such as ILU, which already have all these bindings, it is a waste of effort
> to keep reinventing the wheel. What we should aim for is seamless
> interoperability among the ORBs for different language bindings. Services
> written in one language with one ORB can be deployed straight away and used
> by clients written in another language over a different ORB. Afterall, this
> is what CORBA and component software is about, isn't it?
> 
> I think our focus will continue to be producing a C++ ORB that is fast,
> robust and scalable.

Which I think is fair enough.
However, in the interests of the gnome project, one orb which can do
lots of languages would be a very good thing (smaller memory footprint,
extra speed for finer grained objects etc..). With this in mind I've
just spent the weekend finding out how omniorb works and how easy it
would be to add a layer to provide support for other languages. As it
happens this is actually very easy - the scripting layer is very thin,
and so pretty much all of the internal work is done by omniorb. SWIG
(ftp.cs.utah.edu/pub/beazley/SWIG/) provides the language bindings
pretty much for free. The most difficult bit will be writing a compiler
to generate the language stubs from idl I think. However there are a lot
of idl compilers out there, so we may be able to butcher one to fit our
needs.

If I get time, I'll write up my findings in a short HOWTO type document
tonight, and then perhaps do some asking around for other people to help
in the effort on the gnome group tomorrow.

As regards C support, I think the method you suggest is probably along
the right tracks. Basically, make the layer as thin as possible (since
Sai-Lai is at liberty to change the internals at any point in time in
order to keep the orb small and fast), and make sure you follow the C
language mapping as layed down in the corba spec (http://www.omg.org/).

P.S. I've cc'd this to the gnome group as well, so sorry if you got this
3 times ;-)

P.P.S. I've set followup-to to the gnome group. Please everybody don't
cross-post gnome related things to this group (unless it's relevent
specifically to omniorb).

Cheers,

Phil.

-- 
_______________________________________________________________________
 Phil Dawes                               |   My opinions are my own
 WWW:    err.. temporarily non-existant   |   and nothing to do with
 Email:  philipd@parallax.co.uk           |      my employer.