General-purpose programming language: Difference between revisions

Content deleted Content added
Laurburke (talk | contribs)
m Correct scikit-learn name to be lowercase.
minor changes
Line 6:
Early programming languages were designed either for scientific computing (numerical calculations) or commercial data processing, as was computer hardware. Scientific languages such as [[Fortran]] and [[ALGOL|Algol]] supported floating-point calculations and multidimensional arrays, while business languages such as [[COBOL]] supported fixed-field file formats and [[record (computer science)|data records]]. Much less widely used were specialized languages such as [[IPL-V]] and [[LISP]] for [[List (abstract data type)|symbolic list processing]]; [[COMIT]] for string manipulation; [[APT (programming language)|APT]] for [[Numerical control|numerically controlled machines]]. [[Systems programming]] requiring [[Pointer (computer programming)|pointer manipulation]] was typically done in [[assembly language]], though [[JOVIAL]] was used for some military applications.<ref name="sammet">Jean E. Sammet, "Programming Languages: History and Future", ''Communications of the ACM'' '''15''':7:601-610 (July 1972) {{doi|10.1145/361454.361485}}</ref>
 
[[IBM]]'s [[IBM System/360|System/360]], announced in 1964, was designed as a unified hardware architecture supporting both scientific and commercial applications, and IBM developed [[PL/I]] for it as a single, general-purpose language that supported scientific, commercial, and systems programming. Indeed, a subset of PL/I was used as the standard systems programming language for the [[Multics]] operating system.
 
Since PL/I, the distinction between scientific and commercial programming languages has diminished, with most languages supporting the basic features required by both, and much of the special file format handling delegated to specialized [[Database#Database management system|database management systems]].
Line 12:
Many specialized languages were also developed starting in the 1960s: [[GPSS]] and [[Simula]] for discrete event simulation; [[MAD (programming language)|MAD]], [[BASIC]], [[Logo (programming language)|Logo]], and [[Pascal (programming language)|Pascal]] for teaching programming; [[C (programming language)|C]] for systems programming; [[JOSS]] and [[APL\360]] for interactive programming.<ref name="sammet"/>
 
== GPL Vsvs. 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 (each created for business processing, numeric computation, and symbolic processing respectively), but became GPL’s over time. 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 languagelanguages isare preferred instead ofto DSLs especially 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.
 
=== Advantages and Disadvantages ===
General-purpose programming languages are more commonly used by programmers.  According to a study, [[C (programming language)|C]], [[Python (programming language)|Python]], and [[Java (programming language)|Java]] were the most commonly used programming languages in 2021 respectively.<ref>{{Cite web |title=The Most Popular Programming Languages - 1965/2021 - New Update - Statistics and Data |url=https://statisticsanddata.org/data/the-most-popular-programming-languages-1965-2021/#:~:text=The%20most%20popular%20programming%20languages%20in%202021%20(TIOBE%20Index)&text=The%20most%20popular%20programming%20language,third%20place%20with%20a%2010.31%25 |access-date=2022-06-03 |website=statisticsanddata.org}}</ref> One argument in favor of using general-purpose programming languages over ___domain-specific languages is that more people will be familiar with these languages, overcoming the need to learn a new language.
 
Additionally, for many tasks (i.e.g., statistical analysis, machine learning, etc.) there are libraries that are extensively tested and optimized. Theoretically, the presence of these libraries should bridge the gap between general-purpose and ___domain-specific languages.<ref name=":0" />
 
An empirical study in 2010 sought to measure problem-solving and productivity between GPLs and CSLs by giving users problems who were familiar with the GPL ([[C# (programming language)|C#]]) and unfamiliar with the DSL ([[Extensible Application Markup Language|XAML]]).  Ultimately, users of this specific ___domain-specific language performed better by a factor of 15%, even though they were more familiar with GPL, warranting further research.<ref name=":0" />