Writing C++ code with other target language in mind

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Writing C++ code with other target language in mind

Mathieu Malaterre
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!
--
Mathieu

-------------------------------------------------------------------------
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=/
_______________________________________________
Boost-langbinding mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/boost-langbinding
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Cédric Venet-3
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=/
_______________________________________________
Boost-langbinding mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/boost-langbinding
Loading...