The Mercury Project
MCORBA

[Mercury Logo]
Home

News

Information

Documentation

Mailing Lists

Back-ends

Download

Related
  Applications
  MCORBA
  Contributing Code

Contact

Search

Bug Database

MCORBA is a CORBA binding for Mercury. It allows you to use CORBA objects from Mercury, and allows you to implement CORBA objects in Mercury. This means you can write distributed systems in Mercury, or use Mercury to implement part of a component-based system.

Latest MCORBA News

[11 Sep 2000]MCORBA 0.3 available for download.
After a long delay, a new release of MCORBA is now available. This release works better with newer versions of omniORB (we are using 2.8) and supports threads much better. This version requires a new version of the Mercury compiler -- you will need to download a daily snapshot to use it.
[21 Dec 1998]MCORBA 0.2 available for download.
The second release of MCORBA is finally available. We have fixed the generation of the C++ code so that the samples now build and work correctly.
[17 Nov 1998]New MCORBA paper available
We have made a paper describing the Mercury CORBA interface available from the Mercury papers page.
[23 Sep 1998]MCORBA 0.1 available for download.
The first release of MCORBA has been placed on the web site for download. It is not yet complete, but enough is there that you can see what transformations are done. The most important thing that is missing at the moment is the generation of some of the C++ code.
[21 Sep 1998]MCORBA web page added.
We've just added this page to the Mercury web pages.

Download MCORBA

MCORBA is very much a work-in-progress, however we expect to soon have enough written so that you can start using it to develop applications. For the moment the most important thing missing from the binding is some of the generated C++ code. You can presently use the translator to see how IDL is transformed into Mercury.

Download MCORBA:

MCORBA is distributed under the GNU GPL for the translator, and GNU LGPL for the runtime library.

You will need a copy of omniORB2, which you can freely download from the omniORB web site.

Why use MCORBA?

MCORBA allows Mercury programs to take advantage of existing components, acting as an interface between the Mercury system and an object. This means you can use exisiting components of software as part of a system, and Mercury will be able to easily communicate with them.

It also means you can implement (or re-implement) components of a system in Mercury, and not need to worry about the concerns of the rest of the project.

How does it work?

CORBA objects can communicate with each other even if each object is implemented in different languages and running on different machines. This allows distributed systems to be created,

To the programmer, communicating with a CORBA object is made as easy as possible, given the programming language that is being used. For Mercury, it is as simple as calling a method of a type class.

Here is some Mercury code that reads input strings and sends it to a CORBA object.

:- pred sender_loop(T, io:state, io:state) <= chat(T).
:- mode sender_loop(di, di, uo) is det.
sender_loop(Chat0) -->
    io:read_line(Res),
    (
        { Res = ok(CharList) },
        { string:from_char_list(CharList, String) },
        sendmessage(Chat0, Chat, String),
        sender_loop(Chat)
    ;
        { Res = error(_Error) },
        io:write_string("Some kind of error occurred\n")
    ;
        { Res = eof }
    ).
The type classes and their methods are generated from an Interface Description Language (IDL). This language contains descriptions of the data types that will be used in the system, and the interfaces to various parts of the system. The implementation is left unspecified.

The IDL is transformed into a language specific binding, which allows each programming language to access things in a natural way for that language. For C++, IDL is transformed into classes with methods. For Mercury, IDL is transformed into type classes.