4 ms·
This. SWIG is a heroic effort at cross-language compatibility with C++, but it still gets wonky because C++ interfaces are complex, especially when dealing wit
by username223 9y ago
This. SWIG is a heroic effort at cross-language compatibility with C++, but it still gets wonky because C++ interfaces are complex, especially when dealing with templates. I still find that the best way to do language bindings is to expose a plain C interface that has no name mangling and treats objects as opaque pointers. Then write or generate bindings to call this interface from whatever other language you're using. Finally, wrap that basic functionality by hand.
SQLite is meant to be basic infrastructure that is wrapped by a variety of other languages. It should have a lowest-common-denominator interface, and C is good for that. And while it might be easier to implement it in $FAVORITE_LANGUAGE, SQLite is mature and well-tested. In some sense it's "finished," and throwing it out and replacing it would be a waste of time.