Application programming interface

From Wikipedia, the free encyclopedia

Jump to: navigation, search

An application programming interface (API) is a set of routines, data structures, object classes and/or protocols provided by libraries and/or operating system services in order to support the building of applications.[1] An API may be:

  • Language-dependent; that is, available only in a particular programming language, using the particular syntax and elements of the programming language to make the API convenient to use in this particular context.
  • Language-independent; that is, written in a way that means it can be called from several programming languages (typically an assembly/C-level interface). This is a desired feature for a service-style API that is not bound to a particular process or system and is available as a remote procedure call.

The API itself is largely abstract in that it specifies an interface and controls the behavior of the objects specified in that interface. The software that provides the functionality described by an API is said to be an implementation of the API. An API is typically defined in terms of the programming language used to build an application. The related term, ABI (Application Binary Interface), is a lower level definition concerning details at the Assembly language level. For example, the Linux Standard Base is an ABI, while POSIX is an API.[2]

The API acronym may sometimes be used as a reference not only to the full interface but also to a single function or even a set of multiple APIs provided by an organization. Thus the scope is usually determined by the person or document that communicates the information.

Contents

[edit] Implementations

The POSIX standard defines an API that allows a wide range of common computing functions to be written such that they may operate on many different systems (Mac OS X and various BSDs implement this interface); however, making use of this requires re-compilation for each platform. A compatible ABI, on the other hand, allows compiled object code to function without any changes, on any system implementing that ABI. This is advantageous to both software providers (where they may distribute existing software on new systems without producing/distributing upgrades) and users (where they may install older software on their new systems without purchasing upgrades), although this generally requires various software libraries implementing the necessary APIs too.

Microsoft has shown significant commitment to a backward compatible ABI, particularly within their Win32 library, such that older applications may run on newer versions of Windows. Apple Inc. has shown less propensity to this concern, expiring compatibility or implementing ABI in a slower "emulation mode"; this allows greater freedom in development at the cost of obsoleting older software. Among Unix-like operating systems, there are many related but incompatible operating systems running on a common hardware platform (particularly Intel 80386-compatible systems). There have been several attempts to standardise the ABI such that software vendors may distribute one binary application for all these systems; however to date, none of these have met with much success. The Linux Standard Base is attempting to do this for the Linux platform whilst many of the BSD unices (OpenBSD/NetBSD/FreeBSD) implement various levels of ABI compatibility for both backward compatibility (allowing applications written for older versions to run on newer distributions of the system) and cross-platform compatibility (allowing the execution of foreign code without recompilation).

[edit] Release policies

Common API publishing policies include:

  1. Companies do not release API information to anybody outside of the company.
  2. Companies protect information on their APIs from the general public. For example, Sony used to make its official PlayStation 2 API available only to licensed PlayStation developers. This enabled Sony to control who wrote PlayStation 2 games. Such control can have quality control benefits and potential license revenue.
  3. Companies make their APIs freely available. For example, Microsoft makes the Microsoft Windows API public and Apple releases its APIs Carbon and Cocoa so that software can be written for their platform.

[edit] API examples

Below are listed some well-known APIs.

[edit] Language bindings and interface generators

Below are listed some interface generator tools.

  • SWIG generates interfaces from various languages for Python
  • F2PY: Fortran to Python interface generator.

[edit] See also

[edit] References

  1. ^ "QuickStudy: Application Programming Interface (API)". ComputerWorld. http://www.computerworld.com/action/article.do?command=viewArticleBasic&articleId=43487. 
  2. ^ "Update on Standards". USENIX. https://db.usenix.org/publications/login/2005-04/openpdfs/standards2004.pdf. 

[edit] External links

Personal tools