General-purpose programming language: Difference between revisions

Content deleted Content added
m C: replaced: widely-used → widely used
Correction.
Tags: Visual edit Mobile edit Mobile web edit
 
(One intermediate revision by the same user not shown)
Line 14:
 
== GPL vs. DSL ==
The distinction between general-purpose programming languages and ___domain-specific programming languages is not always clear.<ref>{{Cite journal |last=van Deursen |first=Arie |last2=Klint |first2=Paul |last3=Visser |first3=Joost |date=2000 |title=Domain-Specific Languages: An Annotated Bibliography |journal=ACM SIGPLAN Notices |volume=35 |issue=6 |pages=26-36 |citeseerx=10.1.1.33.8207 |doi=10.1145/352029.352035}}</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'sGPLs 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 |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|doi-access=free }}</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.
 
=== Advantages and disadvantages ===
Line 33:
 
=== C++ ===
Conceived as an extension to C, [[C++]] introduced [[Object-oriented programming|object-oriented]] features, as well as other conveniences like references, operator overloading, and default arguments. Like C, C++'s generality allowed it to be used in a wide range of areas. While its C++'s core area of application is in systems programming (because of C++'s ability to grant access to low-level architecture),<ref>{{Cite book |last=Stroustrup |first=Bjarne |title=The C++ Programming Language |publisher=Addison-Wesley |year=1995}}</ref> it has been used extensively to build desktop applications, video games, databases, financial systems, and much more.<ref name=":1">{{Cite web |title=C++ Applications |url=https://www.stroustrup.com/applications.html |access-date=2022-06-03 |website=www.stroustrup.com}}</ref> Major software and finance companies, such as [[Microsoft]], [[Apple Inc.|Apple]], [[Bloomberg L.P.|Bloomberg]], and [[Morgan Stanley]], still widely use C++ in their internal and external applications.<ref name=":1" />
 
=== Python ===