Archived

This forum has been archived. Please start a new discussion on GitHub.

Ice like SWIG

Hi

I am often need to call C/C++ code from python. Definetly ICE doing
this in very nice manner (no more C++ mapping nightmares :).

But even more often I need to call C/C++ code from python locally, i.e.
as Python module. SWIG is the way to do it. But I think slice is better
as IDL.

Have you guys ever considered having utility to generate Python module
(C code) from slice file?

Regards,
Andrei

Comments

  • Please see this post regarding our support policy (and general information policy) on these forums.

    Cheers
  • done with signature.

    To elaborate a bit on original post: minimum of what I need is ability to collocate Python client and C++ server in single process. Ice doc
    mention collocation on
    page 96 but I was unable to find any examples of how this should work.
    If any examples of client-server collocation exists could anybody point me there.

    More elaborate system could generate Python module C code from slice file.
    It should be possible to make it transparent for implementation code. I.e.
    later on implementation could be reused by remote server.

    I would also suggest to have slice to XML representation generator. slice2docbook looks like good start but XML spec should be more
    appropriate for code generation.
    Then it should be simple to generate Python module C code from XML rep.
  • marc
    marc Florida
    I don't think Ice is suitable for what you need. Ice is distributed object middleware. It is not intended to do something similar to SWIG. Of course, with the source code being open, you can try to write your own Slice compiler that generates such Python module C code.