Inprogramming andsoftware design, abinding is anapplication programming interface (API) that providesglue code specifically made to allow aprogramming language to use a foreignlibrary oroperating system service (one that is not native to that language).
Binding generally refers to a mapping of one thing to another. In the context ofsoftware libraries, bindings arewrapper libraries that bridge twoprogramming languages, so that alibrary written for one language can be used in another language.[1] Many software libraries are written insystem programming languages such asC orC++. To use such libraries from another language, usually ofhigher-level, such asJava,Common Lisp,Scheme,Python, orLua, a binding to the library must be created in that language, possibly requiringrecompiling the language's code, depending on the amount of modification needed.[2] However, most languages offer aforeign function interface, such as Python's andOCaml'sctypes, andEmbeddable Common Lisp'scffi anduffi.[3][4][5]
For example,Python bindings are used when an extantC library, written for some purpose, is to be used from Python. Another example islibsvn which is written in C to provide an API to access theSubversionsoftware repository. To access Subversion from within Java code,libsvnjavahl can be used, which depends onlibsvn being installed and acts as a bridge between the language Java andlibsvn, thus providing an API that invokes functions fromlibsvn to do the work.[6]
Major motives to create library bindings includesoftware reuse, to reduce reimplementing a library in several languages, and the difficulty of implementing somealgorithms efficiently in some high-level languages.
This sectionneeds expansion. You can help byadding missing information.(November 2016) |
This sectionneeds expansion. You can help byadding missing information.(November 2016) |
This sectionneeds expansion. You can help byadding missing information.(November 2016) |
This sectionneeds expansion. You can help byadding missing information.(November 2016) |
This articleis inlist format but may read better asprose. You can help byconverting this article, if appropriate.Editing help is available.(November 2016) |
Thisprogramming-language-related article is astub. You can help Wikipedia byadding missing information. |