API: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Tags: references removed Visual edit Mobile edit Mobile web edit
Line 21:
An API for a [[procedural programming|procedural language]] such as [[Lua (programming language)|Lua]] could primarily consist of basic routines to execute code, manipulate data or handle errors, while an API for an [[object-oriented programming|object-oriented language]] such as [[Java (programming language)|Java]] would provide a specification of classes and their [[class method]]s.<ref>{{cite journal|last1=de Figueiredo|first1=Luiz Henrique|last2=Ierusalimschy|first2=Roberto|last3=Filho|first3=Waldemar Celes|title=The design and implementation of a language for extending applications|journal=TeCGraf Grupo de Tecnologia em Computacao Grafica|url=https://www.researchgate.net/profile/Waldemar_Celes/publication/2778436_The_Design_and_Implementation_of_a_Language_for_Extending_Applications/links/00b7d522f51ad361f9000000.pdf|accessdate=29 July 2016}}</ref><ref name="Sintes16">{{cite web|last1=Sintes|first1=Tony|title=Just what is the Java API anyway?|url=http://www.javaworld.com/article/2077392/java-se/just-what-is-the-java-api-anyway.html|website=JavaWorld|accessdate=29 July 2016}}</ref>
 
[[Language binding]]s are also APIs. By mapping the features and capabilities of one language to an interface implemented in another language, a language binding allows a library or service written in one language to be used when developing in another language.<ref name=Emery>{{cite web|url=http://www.acm.org/tsc/apis.html |last1=Emery|first1=David|title=Standards, APIs, Interfaces and Bindings |publisher=Acm.org |date= |accessdate=2016-08-08}}</ref>Tools such as [[SWIG]] and F2PY, a [[Fortran]]-to-[[Python (programming language)|Python]] interface generator, facilitate the creation of such interfaces.<ref name=cairo>{{cite web|url=http://www.cairographicsf2py.org/manual/language-bindings.html |title=Appendix AF2PY. Creating a language binding for cairoorg |publisher=CairographicsF2PY.org |date= |accessdate=20162011-0812-0818}}</ref>
Tools such as [[SWIG]] and F2PY, a [[Fortran]]-to-[[Python (programming language)|Python]] interface generator, facilitate the creation of such interfaces.<ref>{{cite web|url=http://www.f2py.org/ |title=F2PY.org |publisher=F2PY.org |accessdate=2011-12-18}}</ref>
 
An API can also be related to a [[Framework (computer science)|software framework]]: a framework can be based on several libraries implementing several APIs, but unlike the normal use of an API, the access to the behavior built into the framework is mediated by extending its content with new classes plugged into the framework itself.
Line 40 ⟶ 39:
 
===Operating systems===
An API can specify the interface between an application and the [[operating system]].<ref name="Oreilly91">{{cite book|last1=Lewine|first1=Donald A.|title=POSIX Programmer's Guide|date=1991|publisher=O'Reilly & Associates, Inc.|page=1|url=ftp://gamma.sbin.org/pub/doc/books/OReilly_-_POSIX_Programmers_Guide.pdf|accessdate=2 August 2016}}</ref>[[POSIX]], for example, specifies a set of common APIs that aim to enable an application written for a POSIX conformant operating system to be [[Compiler|compiled]] for another POSIX conformant operating system.
[[POSIX]], for example, specifies a set of common APIs that aim to enable an application written for a POSIX conformant operating system to be [[Compiler|compiled]] for another POSIX conformant operating system.
[[Linux]] and [[Berkeley Software Distribution]] are examples of operating systems that implement the POSIX APIs.<ref name="WestDedrick16">{{cite journal|last1=West|first1=Joel|last2=Dedrick|first2=Jason|title=Open source standardization: the rise of Linux in the network era|journal=Knowledge, Technology & Policy|date=2001|volume=14|issue=2|pages=88–112|url=http://www.joelwest.org/Papers/WestDedrick2001b.pdf|accessdate=2 August 2016|publisher=Springer}}</ref>