On 14-Aug-1998, Timothy Robin BARBOUR <[EMAIL PROTECTED]> wrote:
> >>>>> "David" == David Glen JEFFERY <[EMAIL PROTECTED]> writes:
>
> David> Depending on how you do it, the choice of ORB may not be
> David> such a huge issue. Our (infantile) Mercury implementation
> David> does not talk to the ORB directly, but rather goes via C++
> David> stubs and skeletons. In this way, we have a very small
> David> module of ORB-specific (initialisation etc.) code, but the
> David> rest of our implementation should (we believe ;-) ) work
> David> with any C++ compliant ORB.
>
> How do you produce the stubs and skeletons ? Do you generate them from
> IDL ?
Yes, we have and IDL parser which generates a few files.
We generate a thin layer over the C++ binding at the moment.
Stubs and skeletons are generated as typeclasses.
For the skeleton the Mercury object must be put into a C++ object, and
the methods of the C++ object call the methods of the Mercury object.
For the stubs, an instance of the typeclass is generated that holds
a reference to the C++ object, and just calls the C++ methods.
>
> How does Mercury call C++ anyway - what about the C++ name mangling ?
extern "C" { ..... }.
Mercury doesn't have a native C++ interface, we go via C.
At the moment it's a bit kludgey, you need to put things into separate
files. But since it's all machine generated it isn't too much of a
problem.
We hope in future to interface a bit more directly from C++, so
that you can at least put C++ in your Mercury source code. It's
probable that it will have to be compiled in a separate file, however.
(I don't know whether this will make it to the haskell mailing
lists -- I've tried subscribing several times and had no luck so
far).