3 ms·
SWIG seems really powerful, but not very common in my experience. Why don't we use this more often to create bindings for the same important core libraries acr
by nerdponx 5y ago
SWIG seems really powerful, but not very common in my experience. Why don't we use this more often to create bindings for the same important core libraries across multiple languages?
- elteto 5y agoOh but it is used a lot, just not out in the open. We use it to bridge millions of lines of C and C++ with millions of lines of Perl and Python. It is quirky but really stable once you get it going.
- nerdponx 5y agoAre you able to share what kind of organization does this? What are pros and cons versus an FFI type of library?
- elteto 5y agoHow do you use an FFI with C++ classes? My understanding is that you must lower things down to C level, this is a lot of work and not all scripting languages have the same FFI. SWIG automatically translates (to a certain degree) constructs in one language to another. So a C++ class becomes a Python class. Again, it needs some work to map these things but it mostly just works.
- pjmlp 5y agoIn Windows you make everyone speak COM, or the improved version UWP.
- deleted 5y ago[deleted]