Reputation:
What language, C or C++, is best suited for writing a native library once and using it in different languages with language bindings (for example, using JNI or Ruby's C extensions), and why?
Upvotes: 1
Views: 261
Reputation: 32953
C, because
Upvotes: 6
Reputation: 297
You can write your library in C++ if you like as long as you provide extern "C" bindings/exports to it so the other runtimes can use it.
Upvotes: 4