Let's say i have a huge lib in C++ (with tons of dependencies, it needs about 3h for a full build under GCC). I want to build upon that lib but don't want to do so in C++ but rather in a more productive language. How can i actually bridge or wrap that extern lib package so i can access it in another language and program on top of it?
Languages considered:
- Swift
- Go
What i found is, that both languages do provide auto bridging or wrapping for C libs and code (I don't actually know whats the difference between wrapping / bridging). So, if i have some c code, i can just throw it in the same Swift or Go project and can use it with a simple import in my project.
This doesn't work in both languages for C++ code however. So i googled how to transform C++ libs to C code or generate autowrappers. I found the following:
- swig.org - auto wrapper for C++ libs
- Comeau C++ compiler - automatically transfers C++ to C code
- LLVM - should be able to take any input and transform it to any output that LLVM is capable of.
Question:
- Is it even in the realms of usable / realistic / managable to build on top of such a huge lib in other languages like Swift / Go, if using auto wrapping or auto bridging?
- What of the 3 listed libs / programs / frameworks works best for the process of C++ -> C (because Swift and Go both provide C auto wrapping).
- Are there better alternatives than what i considered so far?
- Would it be better to just "stick with C++" as using any other tools to do the wrapping / bridging process would be far to much work to equal out the benefit of using a more productive language like Swift / Go?
Thanks:)
Disclaimer: There is also the possibility to manually wrap a C++ lib in C but that would take an unbearable amount of work for such a huge lib.