What is a native library? What is the need for binding?

What is a built-in library? What is required? Why is this necessary?

+6
source share
2 answers

A native library is a library written in a language that is compiled using native code for the platform on which it runs, i.e. in C ++ creates PE files with x86 code. Linking or binding a language is a β€œglue” that makes it possible / more convenient to use such a library from another programming language, possibly providing a more elegant interface than just calling directly to your own code (think: better than P / Call, for example )

The question of why it is needed is simple: use a very large number of existing libraries.

+3
source share

Why is this needed? Partly because parts of linguistic capabilities are outside Turing equivalence. Turing Equivalence says that all complete Turing languages ​​(including most programming languages) can calculate the same things. This means that you can do it in one language, which you can do in another, with a few important caveats.

Key warnings include

a) It might be a lot harder to write code to execute x in language A and then language B.
b) Code that x in language B may be faster than language A.
c) The code for executing x may already be written as a good library in language A, but not in language B.

d) Code in one language may be more scalable (easier to manage large bodies of code), and then in another language.

e) Usually you need to not only perform mathematical calculations, but also input / output with local files, databases, network files, web services, gui, including the window system server and, possibly, toolkit, and access to the 3d api that controls the graphic by card.

These reasons, especially e, describe why you might want to bind / wrap a piece of code, often written in a lower-level system language, to use as part of an application written in a higher-level language. Linking code fragments written in different languages ​​can also sometimes be done through code exchanges, such as databases / process communication / web services.

+2
source share

All Articles