Home Comments

Ice like SWIG

asmirnovasmirnov Member

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?



  • beaglesbeagles Member Brent EaglesOrganization: Eagles Technologies IncProject: Asterisk SCF ✭✭✭
    Please see this post regarding our support policy (and general information policy) on these forums.

  • asmirnovasmirnov Member
    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.
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    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.
Sign In or Register to comment.