General-purpose programming language: Difference between revisions

Content deleted Content added
minor changes
clean redundant phrase; mark statement as dubious (see Talk)
Line 1:
{{Short description|Programming language useful for a wide variety of applications}}
In [[computer software]], a '''general-purpose programming language (GPL)''' is a [[programming language]] designed to be used for building [[software]] in a wide variety of application [[Domain (software engineering)|___domain]]s, across a multitude of hardware configurations and operating systems. In theory, a GPL program can run equivalently on a single processor or on a network. The opposite of a general-purpose programming language is a [[___domain-specific programming language]], which is designed to be used within a specific area, for example, [[Query language|querying databases]]. For example, SQL was specifically designed for [[Query language|querying relational databases]].
 
==History==
Line 13:
 
== GPL vs. DSL ==
The distinction between general-purpose programming languages and ___domain-specific programming languages is not always clear.<ref>{{Cite web |title=Domain-Specific Languages: An Annotated Bibliography* |citeseerx=10.1.1.33.8207}}</ref> A programming language may be created for a specific task, but used beyond that original ___domain and thus be considered a general purpose programming language.  For example, [[COBOL]], [[Fortran]], and [[Lisp (programming language)|Lisp]] were created as DSLs (for business processing, numeric computation, and symbolic processing), but became GPL’s over time.{{Dubious|date=December 2022}} Inversely, a language may be designed for general use but only applied in a specific area in practice.<ref>{{Cite journal |last=Berry |first=Gerard |date=May 2006 |title=Real time programming: special purpose or general purpose languages |url=https://hal.inria.fr/inria-00075494/document |journal=HAL Open Science}}</ref> A programming language that is well suited for a problem, whether it be general-purpose language or DSL, should minimize the level of detail required while still being expressive enough in the problem ___domain.<ref name=":0">{{Cite journal |last=Kosar |first=Tomaz |date=May 2010 |title=Comparing General-Purpose and Domain-Specific Languages: An Empirical Study |url=http://www.doiserbia.nb.rs/img/doi/1820-0214/2010/1820-02141002247K.pdf |journal=Computer Science and Information Systems|volume=7 |issue=2 |pages=247–264 |doi=10.2298/CSIS1002247K }}</ref> As the name suggests, general-purpose language is “general” in that it cannot provide support for ___domain-specific notation while DSLs can be designed in diverse problem domains to handle this problem.<ref name=":0" /> General-purpose languages are preferred to DSLs when an application ___domain is not well understood enough to warrant its own language. In this case, a general-purpose language with an appropriate library of data types and functions for the ___domain may be used instead.<ref>{{Cite journal |last=van Deursen |first=Arie |date=December 1998 |title=Little languages: little maintenance? |url=https://onlinelibrary.wiley.com/doi/pdf/10.1002/%28SICI%291096-908X%28199803/04%2910%3A2%3C75%3A%3AAID-SMR168%3E3.0.CO%3B2-5?casa_token=bfXER4EyrCwAAAAA:Bt4H71BHCy8gsRA2dcgefnXVV__9utfLAjeoyk2NRudR2IV2yPU43JC1L_dtbVJRdoI1ZTsyRCQgX9A |journal=Journal of Software Maintenance: Research and Practice|volume=10 |issue=2 |pages=75–92 |doi=10.1002/(SICI)1096-908X(199803/04)10:2<75::AID-SMR168>3.0.CO;2-5 }}</ref> While DSLs are usually smaller than GPL in that they offer a smaller range of notations of abstractions, some DSLs actually contain an entire GPL as a sublanguage. In these instances, the DSLs are able to offer ___domain-specific expressive power along with the expressive power of GPL.<ref>{{Cite journal |last1=van Deursen |first1=Arie |last2=Klint |first2=Paul |last3=Visser |first3=Joost |date=June 2000 |title=Domain-specific languages: an annotated bibliography |url=https://dl.acm.org/doi/10.1145/352029.352035 |journal=ACM SIGPLAN Notices |language=en |volume=35 |issue=6 |pages=26–36 |doi=10.1145/352029.352035 |s2cid=1049872 |issn=0362-1340}}</ref>
 
General Purpose programming languages are all [[Turing completeness|Turing complete]], meaning that they can theoretically solve any computational problem. Domain-specific languages are often similarly Turing complete but are not exclusively so.