In
computer software
Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work.
At the lowest programming level, executable code consists ...
, a general-purpose programming language (GPL) is a
programming language
A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language.
The description of a programming l ...
for building
software
Software is a set of computer programs and associated software documentation, documentation and data (computing), data. This is in contrast to Computer hardware, hardware, from which the system is built and which actually performs the work.
...
in a wide variety of application
domains. Conversely, a
domain-specific programming language is used within a specific area. For example,
SQL was specifically designed for
querying relational databases.
History
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 (; short for "Algorithmic Language") is a family of imperative computer programming languages originally developed in 1958. ALGOL heavily influenced many other languages and was the standard method for algorithm description used by th ...
supported floating-point calculations and multidimensional arrays, while business languages such as
COBOL supported fixed-field file formats and
data records
Ministry of Sound or Ministry of Sound Group is a multimedia entertainment business based in London with a nightclub, shared workspace and private members' club, worldwide events operation, music publishing business and fitness studio.
...
. Much less widely used were specialized languages such as
IPL-V
Information Processing Language (IPL) is a programming language created by Allen Newell, Cliff Shaw, and Herbert A. Simon at RAND Corporation and the Carnegie Institute of Technology about 1956. Newell had the job of language specifier-applicatio ...
and
LISP
A lisp is a speech impairment in which a person misarticulates sibilants (, , , , , , , ). These misarticulations often result in unclear speech.
Types
* A frontal lisp occurs when the tongue is placed anterior to the target. Interdental lispi ...
for
symbolic list processing;
COMIT for string manipulation;
APT
Apt. is an abbreviation for apartment.
Apt may also refer to:
Places
* Apt Cathedral, a former cathedral, and national monument of France, in the town of Apt in Provence
* Apt, Vaucluse, a commune of the Vaucluse département of France
* A ...
for
numerically controlled machines.
Systems programming requiring
pointer manipulation was typically done in
assembly language, though
JOVIAL was used for some military applications.
[Jean E. Sammet, "Programming Languages: History and Future", ''Communications of the ACM'' 15:7:601-610 (July 1972) ]
IBM's
System/360
The IBM System/360 (S/360) is a family of mainframe computer systems that was announced by IBM on April 7, 1964, and delivered between 1965 and 1978. It was the first family of computers designed to cover both commercial and scientific applic ...
, 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 management systems.
Many specialized languages were also developed starting in the 1960s:
GPSS and
Simula
Simula is the name of two simulation programming languages, Simula I and Simula 67, developed in the 1960s at the Norwegian Computing Center in Oslo, by Ole-Johan Dahl and Kristen Nygaard. Syntactically, it is an approximate superset of AL ...
for discrete event simulation;
MAD,
BASIC
BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...
,
Logo
A logo (abbreviation of logotype; ) is a graphic mark, emblem, or symbol used to aid and promote public identification and recognition. It may be of an abstract or figurative design or include the text of the name it represents as in a wordm ...
, and
Pascal for teaching programming;
C for systems programming;
JOSS and
APL\360 for interactive programming.
GPL vs. DSL
The distinction between general-purpose programming languages and domain-specific programming languages is not always clear. 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
A lisp is a speech impairment in which a person misarticulates sibilants (, , , , , , , ). These misarticulations often result in unclear speech.
Types
* A frontal lisp occurs when the tongue is placed anterior to the target. Interdental lispi ...
were created as DSLs (for business processing, numeric computation, and symbolic processing), but became GPL’s over time. Inversely, a language may be designed for general use but only applied in a specific area in practice. 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.
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.
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. 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.
General Purpose programming languages are all
Turing complete
Alan Mathison Turing (; 23 June 1912 – 7 June 1954) was an English mathematician, computer scientist, logician, cryptanalyst, philosopher, and theoretical biologist. Turing was highly influential in the development of theoretical co ...
, 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,
Python, and
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
were the most commonly used programming languages in 2021. 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.
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#) and unfamiliar with the DSL (
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.
Examples
C
The predecessor to
C,
B, was developed largely for a specific purpose:
systems programming. By contrast, C has found use in a variety of computational domains, such as
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
s,
device drivers,
application software
Application may refer to:
Mathematics and computing
* Application software, computer software designed to help the user to perform specific tasks
** Application layer, an abstraction layer that specifies protocols and interface methods used in a ...
, and
embedded system
An embedded system is a computer system—a combination of a computer processor, computer memory, and input/output peripheral devices—that has a dedicated function within a larger mechanical or electronic system. It is ''embedded'' ...
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. As a result, though it was first used by its creators to rewrite the kernel of the
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
operating system, it was easily adapted for use in application development, embedded systems (e.g., microprocessor programming), video games (e.g.,
Doom), and so on. Today, C remains one of the most popular and widely-used programming languages.
C++
Conceived as an extension to
C,
C++ introduced
object-oriented
Object-oriented programming (OOP) is a programming paradigm based on the concept of " objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of ...
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), it has been used extensively to build desktop applications, video games, databases, financial systems, and much more.
Major software and finance companies, such as
Microsoft
Microsoft Corporation is an American multinational corporation, multinational technology company, technology corporation producing Software, computer software, consumer electronics, personal computers, and related services headquartered at th ...
,
Apple
An apple is an edible fruit produced by an apple tree (''Malus domestica''). Apple trees are cultivated worldwide and are the most widely grown species in the genus '' Malus''. The tree originated in Central Asia, where its wild ances ...
,
Bloomberg Bloomberg may refer to:
People
* Daniel J. Bloomberg (1905–1984), audio engineer
* Georgina Bloomberg (born 1983), professional equestrian
* Michael Bloomberg (born 1942), American businessman and founder of Bloomberg L.P.; politician and ...
, and
Morgan Stanley
Morgan Stanley is an American multinational investment management and financial services company headquartered at 1585 Broadway in Midtown Manhattan, New York City. With offices in more than 41 countries and more than 75,000 employees, the f ...
, still widely use C++ in their internal and external applications.
Python
Python was conceived as a language that emphasized code readability and extensibility. The former allowed non-software engineers to easily learn and write computer programs, while the latter allowed domain specialists to easily create libraries suited to their own use cases. For these reasons, Python has been used across a wide range of domains.
Below are some of the areas where Python is used:
* Web Development: Frameworks like
Django and
Flask have allowed web developers to create robust web servers that can also take advantage of the wider Python ecosystem.
* Science and Academia: Scientific and data libraries, like
SciPy and
Pandas, have enabled Python’s use in scientific research.
* Machine Learning: Libraries like
scikit-learn and
Tensorflow have increased the accessibility of machine learning to developers.
* General Software Development: Developing user applications, web scraping programs, games, and other general software.
List
The following are some general-purpose programming languages:
*
C
*
C++
*
C#
*
Clojure
*
Crystal
A crystal or crystalline solid is a solid material whose constituents (such as atoms, molecules, or ions) are arranged in a highly ordered microscopic structure, forming a crystal lattice that extends in all directions. In addition, macr ...
*
D
*
Dart
Dart or DART may refer to:
* Dart, the equipment in the game of darts
Arts, entertainment and media
* Dart (comics), an Image Comics superhero
* Dart, a character from ''G.I. Joe''
* Dart, a ''Thomas & Friends'' railway engine character
* D ...
*
Delphi
Delphi (; ), in legend previously called Pytho (Πυθώ), in ancient times was a sacred precinct that served as the seat of Pythia, the major oracle who was consulted about important decisions throughout the ancient classical world. The oracl ...
*
Elixir
*
Erlang
*
F#
*
Go
*
Harbour
A harbor (American English), harbour (British English; see spelling differences), or haven is a sheltered body of water where ships, boats, and barges can be docked. The term ''harbor'' is often used interchangeably with ''port'', which is ...
*
Haskell
*
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
*
JavaScript
JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
*
Julia
*
Kotlin
*
Lua
Lua or LUA may refer to:
Science and technology
* Lua (programming language)
* Latvia University of Agriculture
* Last universal ancestor, in evolution
Ethnicity and language
* Lua people, of Laos
* Lawa people, of Thailand sometimes referred t ...
*
Modula-2
*
Oberon
*
Objective-C
Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was selected by NeXT for its N ...
*
OCaml
*
Perl
Perl is a family of two High-level programming language, high-level, General-purpose programming language, general-purpose, Interpreter (computing), interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it ...
*
PHP
PHP is a General-purpose programming language, general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementati ...
*
Pike
*
PL/I
*
Python
*
Racket
Racket may refer to:
* Racket (crime), a systematised element of organized crime
** Protection racket, a scheme whereby a group provides protection to businesses or other groups through violence outside the sanction of the law
* Racket (sports equ ...
*
Ruby
A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum (aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sapp ...
*
Rust
*
Scala
*
Swift
*
Tcl
*
Visual Basic
*
Visual Basic .NET
*
Zig{{div col end
Notes
See also
*
General-purpose markup language
*
General-purpose modeling language
Programming languages