Re: Writing C++ code with other target language in mind

Cédric Venet <[email protected]>
Newsgroups gmane.comp.lib.boost.langbinding
Message-ID <[email protected]>
Mathieu Malaterre a écrit :
> Hi there,
>
>   I am looking for a documentation / handbook for programmer writing a
> C++ library, which API need to be 'wrappable' into another language.
>   I guess it all depend on
> 1. the target language, but I am thinking (I am not an expert) that a
> lot of scripting language are very C-oriented (python, tcl, java...).
> 2. The third party tool used to wrap the interface (swig, pygccxml)
>   There are some obvious one: template cannot be exposed directly. But
> some are more subtle: can you define an interface which return stl
> iterators, can you return shared_ptr, can you throw exception...
>
>   Has anyone seen such document ?
>
> Thanks!
>   
AFAIK, the C++ ABI isn't standard (and very complex) so the best (and 
only way) to go is to wrap your C++ API in a C api and call this from 
your other language (where you can rebuild an OO abstration layer)

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.