Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
General-purpose programming language
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Programming language used in many domains}} In [[computer software]], a '''general-purpose programming language''' ('''GPL''') is a [[programming language]] for building [[software]] in a wide variety of application [[Domain (software engineering)|domain]]s. Conversely, a [[Domain-specific language|domain-specific programming language]] (DSL) is used within a specific area. For example, [[Python (programming language)|Python]] is a GPL, while [[SQL]] is a DSL for [[Query language|querying relational databases]]. ==History== Early programming languages were designed 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]]. 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|APL\360]] for interactive programming.<ref name="sammet"/> == 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'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 |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 === 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.<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 (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 DSLs by giving users problems who were familiar with the GPL ([[C Sharp (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" /> == Examples == === C === The predecessor to [[C (programming language)|C]], [[B (programming language)|B]], was developed largely for a specific purpose: [[systems programming]].<ref>{{Cite web |last=Thompson |first=K. |date=1972-01-07 |title=Cover sheet for technical memorandum |url=https://www.bell-labs.com/usr/dmr/www/kbman.pdf |url-status=live |archive-url=https://web.archive.org/web/20150611114427/https://www.bell-labs.com/usr/dmr/www/kbman.pdf |archive-date=2015-06-11 |access-date=2022-06-03 |publisher=[[Bell Telephone Laboratories]]}}</ref> By contrast, C has found use in a variety of computational domains, such as [[operating system]]s, [[device driver]]s, [[application software]], and [[embedded system]]s. C is suitable for use in a variety of areas because of its generality. It provides economy of expression, flow control, data structures, and a rich set of operators, but does not constrain its users to use it in any one context.<ref>{{Cite book |last=W. |first=Kernighan, Brian |url=http://worldcat.org/oclc/1004153413 |title=The C programming language |date=2016 |publisher=Prentice Hall |isbn=978-0-13-110370-2 |oclc=1004153413}}</ref> As a result, though it was first used by its creators to rewrite the kernel of the [[Unix]] operating system,<ref>{{Cite journal |last=Ritchie |first=Dennis |date=April 1993 |title=The development of the C language |url=https://www.bell-labs.com/usr/dmr/www/chist.pdf |journal=ACM SIGPLAN Notices|volume=28 |issue=3 |pages=201β208 |doi=10.1145/155360.155580 }}</ref> it was easily adapted for use in application development, embedded systems (e.g., microprocessor programming), video games (e.g., [[Doom (franchise)|Doom]]), and so on. Today, C remains one of the most popular and widely-used programming languages.<ref>{{Cite web |title=TIOBE Index |url=https://www.tiobe.com/tiobe-index/ |access-date=2022-06-03 |website=TIOBE |language=en-US}}</ref> === 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 === [[Python (programming language)|Python]] was conceived as a language that emphasized code readability and extensibility.<ref>{{Cite web |title=artima β The Making of Python |url=https://www.artima.com/articles/the-making-of-python |access-date=2022-06-03 |website=www.artima.com}}</ref><ref>{{Cite web |title=General Python FAQ β Python 3.10.4 documentation |url=https://docs.python.org/3/faq/general.html#why-was-python-created-in-the-first-place |access-date=2022-06-03 |website=docs.python.org}}</ref> The former allowed non-software engineers to easily learn and write computer programs, while the latter allowed domain specialists to easily create [[Library (computing)|libraries]] suited to their own use cases. For these reasons, Python has been used across a wide range of domains. Some areas where Python is used include:<ref>{{Cite web |title=Applications for Python |url=https://www.python.org/about/apps/ |access-date=2022-06-03 |website=Python.org |language=en}}</ref> * ''Web development'' β Frameworks like [[Django (web framework)|Django]] and [[Flask (web framework)|Flask]] have allowed web developers to create robust web servers that can also exploit the wider Python ecosystem. * ''Science and academia'' β Scientific and data libraries, like [[SciPy]] and [[Pandas (software)|Pandas]], have enabled Python's use in scientific research.<ref>{{Cite web |title=Programming Languages Popularity in 12,086 Research Papers β Quantifying Health |url=https://quantifyinghealth.com/programming-languages-popularity-in-research/ |access-date=2022-06-03 |language=en-US}}</ref> * ''Machine learning'' β Libraries like [[scikit-learn]] and [[TensorFlow]] have made [[machine learning]] more accessible to developers.<ref>{{Cite journal |last1=Pedregosa |first1=Fabian |date=2011 |title=Scikit-learn: Machine learning in Python |url=https://www.jmlr.org/papers/volume12/pedregosa11a/pedregosa11a.pdf?ref=https://githubhelp.com |journal=The Journal of Machine Learning Research |volume=12 |pages=2825β2830 |arxiv=1201.0490 |bibcode=2011JMLR...12.2825P}}</ref> * ''General software development'' β Developing user applications, web scraping programs, games, and other general software. ==List== {{Main|List of programming languages}} The following are some general-purpose programming languages: {{div col|colwidth=15em}} * [[C (programming language)|C]] * [[C++]] * [[C Sharp (programming language)|C#]] * [[Clojure]] * [[Crystal (programming language)|Crystal]] * [[D (programming language)|D]] * [[Dart (programming language)|Dart]] * [[Delphi (software)|Delphi]] * [[Elixir (programming language)|Elixir]] * [[Erlang (programming language)|Erlang]] * [[F Sharp (programming language)|F#]] * [[Go (programming language)|Go]] * [[Harbour (programming language)|Harbour]] * [[Haskell]] * [[Java (programming language)|Java]] * [[JavaScript]] * [[Julia (programming language)|Julia]] * [[Kotlin (programming language)|Kotlin]] * [[Lua (programming language)|Lua]] * [[Modula-2]] * [[Oberon (programming language)|Oberon]] * [[Objective-C]] * [[OCaml]] * [[Perl]] * [[PHP]] * [[Pike (programming language)|Pike]] * [[PL/I]] * [[Python (programming language)|Python]] * [[Racket (programming language)|Racket]] * [[Ruby (programming language)|Ruby]] * [[Rust (programming language)|Rust]] * [[Scala (programming language)|Scala]] * [[Swift (programming language)|Swift]] * [[Tcl]] * [[V (programming language)|V]] * [[Visual Basic]] * [[Visual Basic (.NET)]] * [[Zig (programming language)|Zig]]{{div col end}} ==See also== * [[General-purpose markup language]] * [[General-purpose modeling language]] ==References== <references responsive="0" /> [[Category:Programming languages]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Div col
(
edit
)
Template:Div col end
(
edit
)
Template:Doi
(
edit
)
Template:Dubious
(
edit
)
Template:Fix
(
edit
)
Template:Main
(
edit
)
Template:Short description
(
edit
)