How do they write different language wrappers for the same library?

Typically, a library will be released in one language (for example, C). If the library is configured to be useful, then many language shells will be written for this library. How exactly do they do it?

No wonder someone sheds a little light on this topic. If it is too dependent on the language, select the language of your choice and explain it.

+6
language-agnostic
source share
1 answer

There are several options that come to mind:

  • Port the source C library to the language / platform of your choice.
  • Compile the C library into something (for example, a DLL) that can be called from other components
  • Put the library on the Internet, put the API through HTTP and wrap it on the client

If I wanted to wrap the C library with a managed (.NET) level, I would compile the library into a DLL, providing the necessary APIs. Then I would use P / Invoke to call these APIs from my C # code.

+5
source share

All Articles