All Topics  
Programming language

 

 

 

 

 

Programming language


 
 
A programming language is an artificial languageFacts About Artificial language

An artificial language is a language created by a person or a group of people for a certain purpose, usually when this purpo...
 that can be used to control the behavior of a machine, particularly a computerComputer

A computer is a machine for manipulating data according to a list of instructions known as a program....
. Programming languages are defined by syntacticSyntax

In linguistics, Syntax, originating from the Greek words s?? and t???? , is the study of the rules, or "patterned relations...
 and semantic rules which describe their structure and meaning respectively. Many programming languages have some form of written specification of their syntax and semantics; some are defined only by an official implementation.

Programming languages are used to facilitate communication about the task of organizing and manipulating information, and to express algorithmAlgorithm

In mathematics and computing, an algorithm is a procedure for accomplishing some task which, given an initial state, will t...
s precisely. Some authors restrict the term "programming language" to those languages that can express all possible algorithms; sometimes the term "computer languageFacts About Computer language

A computer language is a language used by, or in association with, computers....
" is used for more limited artificial languages.

Thousands of different programming languages have been created so far, and new languages are created every year.
DefinitionsTraits often considered important for constituting a programming language:









Non-computational languages, such as markup languageMarkup language

A markup language combines text and extra information about the text....
s like HTMLHTML

In computing, HyperText Markup Language is a predominant markup language for the creation of web pages....
 or formal grammarFormal grammar

In computer science and linguistics, a formal grammar is an abstract structure that describes a formal language precisely, i...
s like BNFBackus–Naur form

The BackusNaur form is a metasyntax used to express context-free grammars: that is, a formal way to describe formal languag...
, are usually not considered programming languages.






Discussion
Ask a question about 'Programming language'
Start a new discussion about 'Programming language'
Answer questions from other users
Full Discussion Forum






Timeline

1957   IBM makes FORTRAN scientific programming language available to customers. It becomes the most widely used computer language for technical work.

1964   At 4:00 a.m., John George Kemeny and Thomas Eugene Kurtz run the first program written in BASIC (Beginners' All-purpose Symbolic Instruction Code), an easy to learn high level programming language which they have created. BASIC will eventually be included on many computers and even some games consoles.






Encyclopedia


A programming language is an artificial languageFacts About Artificial language

An artificial language is a language created by a person or a group of people for a certain purpose, usually when this purpo...
 that can be used to control the behavior of a machine, particularly a computerComputer

A computer is a machine for manipulating data according to a list of instructions known as a program....
. Programming languages are defined by syntacticSyntax

In linguistics, Syntax, originating from the Greek words s?? and t???? , is the study of the rules, or "patterned relations...
 and semantic rules which describe their structure and meaning respectively. Many programming languages have some form of written specification of their syntax and semantics; some are defined only by an official implementation.

Programming languages are used to facilitate communication about the task of organizing and manipulating information, and to express algorithmAlgorithm

In mathematics and computing, an algorithm is a procedure for accomplishing some task which, given an initial state, will t...
s precisely. Some authors restrict the term "programming language" to those languages that can express all possible algorithms; sometimes the term "computer languageFacts About Computer language

A computer language is a language used by, or in association with, computers....
" is used for more limited artificial languages.

Thousands of different programming languages have been created so far, and new languages are created every year.

Definitions

Traits often considered important for constituting a programming language:

  • Function: A programming language is a language used to write computer programComputer program

    Most computer programs consist of a list of instructions that explicitly implement an algorithm , another form of computer ...
    s, which involve a computerComputer

    A computer is a machine for manipulating data according to a list of instructions known as a program....
     performing some kind of computationComputation

    Computation is a general term for any type of information processing....
     or algorithmAlgorithm

    In mathematics and computing, an algorithm is a procedure for accomplishing some task which, given an initial state, will t...
     and possibly control external devices such as printersComputer printer

    A computer printer, or more commonly just a printer, is a device that produces a hard copy of documents stored in ele...
    , robots, and so on.


  • Target: Programming languages differ from natural languageNatural language

    The term natural language is used to distinguish languages spoken and signed by humans for general-purpose communication fr...
    s in that natural languages are only used for interaction between people, while programming languages also allow humans to communicate instructions to machines. Some programming languages are used by one device to control another. For example PostScriptPostScript Overview

    PostScript is a page description language and programming language used primarily in the electronic and desktop publishing ...
     programs are frequently created by another program to control a computer printerComputer printer

    A computer printer, or more commonly just a printer, is a device that produces a hard copy of documents stored in ele...
     or display.


  • Constructs: Programming languages may contain constructs for defining and manipulating data structureData structure

    In computer science, a data structure is a way of storing data in a computer so that it can be used efficiently....
    s or controlling the flow of executionControl flow Summary

    In computer science control flow refers to the order in which the individual statements or instructions of an imperative pr...
    .


  • Expressive power: The theory of computationTheory of computation Summary

    The theory of computation is the branch of computer science that deals with whether and how efficiently problems can be solv...
     classifies languages by the computations they are capable of expressing. All Turing complete languages can implement the same set of algorithmAlgorithm

    In mathematics and computing, an algorithm is a procedure for accomplishing some task which, given an initial state, will t...
    s. ANSI/ISO SQLSQL

    SQL is the most popular computer language used to create, modify, retrieve and manipulate data from relational database man...
     and CharityCharity programming language

    Charity is a purely functional experimental programming language, developed at Calgary....
     are examples of languages that are not Turing complete yet often called programming languages.


Non-computational languages, such as markup languageMarkup language

A markup language combines text and extra information about the text....
s like HTMLHTML

In computing, HyperText Markup Language is a predominant markup language for the creation of web pages....
 or formal grammarFormal grammar

In computer science and linguistics, a formal grammar is an abstract structure that describes a formal language precisely, i...
s like BNFBackus–Naur form

The BackusNaur form is a metasyntax used to express context-free grammars: that is, a formal way to describe formal languag...
, are usually not considered programming languages. A programming language (which may or may not be Turing complete) may be embedded in these non-computational (host) languages.

Purpose

A prominent purpose of programming languages is to provide instructions to a computer. As such, programming languages differ from most other forms of human expression in that they require a greater degree of precision and completeness. When using a natural language to communicate with other people, human authors and speakers can be ambiguous and make small errors, and still expect their intent to be understood. However, figuratively speaking, computers "do exactly what they are told to do", and cannot "understand" what code the programmer intended to write. The combination of the language definition, the programComputer program

Most computer programs consist of a list of instructions that explicitly implement an algorithm , another form of computer ...
, and the program's inputs must fully specify the external behavior that occurs when the program is executed.

Many languages have been designed from scratch, altered to meet new needs, combined with other languages, and eventually fallen into disuse. Although there have been attempts to design one "universal" computer language that serves all purposes, all of them have failed to be accepted in this role. The need for diverse computer languages arises from the diversity of contexts in which languages are used:

  • Programs range from tiny scripts written by individual hobbyists to huge systems written by hundreds of programmers.
  • Programmers range in expertise from novices who need simplicity above all else, to experts who may be comfortable with considerable complexity.
  • Programs must balance speed, size, and simplicity on systems ranging from microcontrollerMicrocontroller

    A microcontroller is a computer-on-a-chip used to control electronic devices....
    s to supercomputerSupercomputer

    A supercomputer is a computer that leads the world in terms of processing capacity, particularly speed of calculation, at th...
    s.
  • Programs may be written once and not change for generations, or they may undergo nearly constant modification.
  • Finally, programmers may simply differ in their tastes: they may be accustomed to discussing problems and expressing them in a particular language.


One common trend in the development of programming languages has been to add more ability to solve problems using a higher level of abstractionAbstraction (computer science)

In computer science, abstraction is a mechanism and practice to reduce and factor out details so that one can focus on a few...
. The earliest programming languages were tied very closely to the underlying hardware of the computer. As new programming languages have developed, features have been added that let programmers express ideas that are more remote from simple translation into underlying hardware instructions. Because programmers are less tied to the complexity of the computer, their programs can do more computing with less effort from the programmer. This lets them write more functionality per time unit.

Natural language processors have been proposed as a way to eliminate the need for a specialized language for programming. However, this goal remains distant and its benefits are open to debate. Edsger DijkstraEdsger Dijkstra

Prof Dr Edsger Wybe Dijkstra was a Dutch computer scientist....
 took the position that the use of a formal language is essential to prevent the introduction of meaningless constructs, and dismissed natural language programming as "foolish." Alan PerlisAlan Perlis

Alan Jay Perlis was a prominent U.S....
 was similarly dismissive of the idea.

Elements


Syntax




A programming language's surface form is known as its syntaxSyntax of programming languages

In computer science, the syntax of a programming language is the set of rules that a sequence of characters in a source code file ...
. Most programming languages are purely textual; they use sequences of text including words, numbers, and punctuation, much like written natural languages. On the other hand, there are some programming languages which are more graphicalVisual programming language

Visual programming language is any programming language that lets users specify programs by manipulating program elements gr...
 in nature, using spatial relationships between symbols to specify a program.

The syntax of a language describes the possible combinations of symbols that form a syntactically correct program. The meaning given to a combination of symbols is handled by semantics (either formalFormal semantics of programming languages

In theoretical computer science, formal semantics is the field concerned with the rigorous mathematical study of the meaning...
 or hard-coded in a reference implementationReference implementation (computing)

In computing, a reference implementation is a software example of a standard for use in helping others implement their own v...
). Since most languages are textual, this article discusses textual syntax.

Programming language syntax is usually defined using a combination of regular expressionRegular expression

A regular expression is a string that describes or matches a set of strings, according to certain syntax rules....
s (for lexicalLexical analysis

Lexical analysis is the processing of an input sequence of characters to produce, as output, a sequence of symbols called "l...
 structure) and Backus-Naur Form (for grammaticalContext-free grammar

In linguistics and computer science, a context-free grammar is a formal grammar in which every production rule is of the fo...
 structure). Below is a simple grammar, based on LispLisp programming language

Lisp is a family of computer programming languages with a long history and a distinctive fully-parenthesized syntax....
:


expression = atom | list

atom = number | symbol

number = [+-]?['0'-'9']+

symbol = ['A'-'Z''a'-'z'].*

list = '(' expression* ')'



This grammar specifies the following:
  • an expression is either an atom or a list;
  • an atom is either a number or a symbol;
  • a number is an unbroken sequence of one or more decimal digits, optionally preceded by a plus or minus sign;
  • a symbol is a letter followed by zero or more of any characters (excluding whitespace); and
  • a list is a matched pair of parentheses, with zero or more expressions inside it.


The following are examples of well-formed token sequences in this grammar: '12345', '()', '(a b c232 (1))'

Not all syntactically correct programs are semantically correct. Many syntactically correct programs are nonetheless ill-formed, per the language's rules; and may (depending on the language specification and the soundness of the implementation) result in an error on translation or execution. In some cases, such programs may exhibit undefined behavior. Even when a program is well-defined within a language, it may still have a meaning that is not intended by the person who wrote it.

Using natural languageNatural language

The term natural language is used to distinguish languages spoken and signed by humans for general-purpose communication fr...
 as an example, it may not be possible to assign a meaning to a grammatically correct sentence or the sentence may be false:
  • "Colorless green ideas sleep furiouslyColorless green ideas sleep furiously

    "Colorless green ideas sleep furiously" is a sentence composed by Noam Chomsky in 1957 as an example of a sentence whose...
    ." is grammatically well-formed but has no generally accepted meaning.
  • "John is a married bachelor." is grammatically well-formed but expresses a meaning that cannot be true.


The following C language fragment is syntactically correct, but performs an operation that is not semantically defined (because p is a null pointer, the operations p->real and p->im have no meaning):

complex *p = NULL;
complex abs_p = sqrt (p->real * p->real + p->im * p->im);

The grammar needed to specify a programming language can be classified by its position in the Chomsky hierarchyChomsky hierarchy

Within the field of computer science, specifically in the area of programming languages, the Chomsky hierarchy is a contain...
. The syntax of most programming languages can be specified using a Type-2 grammar, i.e., they are context-free grammarContext-free grammar

In linguistics and computer science, a context-free grammar is a formal grammar in which every production rule is of the fo...
s.

Static semantics


The static semantics defines restrictions on the structure of valid texts that are hard or impossible to express in standard syntactic formalisms. The most important of these restrictions are covered by type systems.

Type system


A type system defines how a programming language classifies values and expressions into types, how it can manipulate those types and how they interact. This generally includes a description of the data structureData structure

In computer science, a data structure is a way of storing data in a computer so that it can be used efficiently....
s that can be constructed in the language. The design and study of type systems using formal mathematics is known as type theoryType theory

At the broadest level, type theory is the branch of mathematics and logic that first creates a hierarchy of types, then assi...
.

Internally, all dataData

In general, data consists of propositions that reflect reality....
 in modern digital computers are stored simply as zeros or ones.
Typed versus untyped languages
A language is typed if the specification of every operation defines types of data to which the operation is applicable, with the implication that it is not applicable to other types. For example, "this text between the quotes" is a string. In most programming languages, dividing a number by a string has no meaning. Most modern programming languages will therefore reject any program attempting to perform such an operation. In some languages, the meaningless operation will be detected when the program is compiled ("static" type checking), and rejected by the compiler, while in others, it will be detected when the program is run ("dynamic" type checking), resulting in a runtime exceptionException handling

Exception handling is a programming language construct or computer hardware mechanism designed to handle the occurrence of s...
.

A special case of typed languages are the single-type languages. These are often scripting or markup languages, such as RexxREXX Overview

REXX is an interpreted programming language which was developed at IBM....
 or SGML, and have only one data type — most commonly character strings which are used for both symbolic and numeric data.

In contrast, an untyped language, such as most assembly languageAssembly language

Assembly language refers to a class of low-level languages used to write computer programs, or to a particular such language...
s, allows any operation to be performed on any data, which are generally considered to be sequences of bits of various lengths. High-level languages which are untyped include BCPLBCPL

BCPL is a computer programming language that was designed by Martin Richards of the University of Cambridge in 1966; it was...
 and some varieties of Forth.

In practice, while few languages are considered typed from the point of view of type theoryType theory

At the broadest level, type theory is the branch of mathematics and logic that first creates a hierarchy of types, then assi...
 (verifying or rejecting all operations), most modern languages offer a degree of typing. Many production languages provide means to bypass or subvert the type system.
Static versus dynamic typing
In static typing all expressions have their types determined prior to the program being run (typically at compile-time). For example, 1 and (2+2) are integer expressions; they cannot be passed to a function that expects a string, or stored in a variable that is defined to hold dates.

Statically-typed languages can be manifestly typed or type-inferredType inference

Type inference is a feature present in some strongly statically typed programming languages....
. In the first case, the programmer must explicitly write types at certain textual positions (for example, at variable declarationDeclaration (computer science)

In computer science, a declaration specifies a variable's dimensions, identifier, type, and other aspects....
s). In the second case, the compiler infers the types of expressions and declarations based on context. Most mainstream statically-typed languages, such as C++, C# and JavaJava (programming language)

Java is an object-oriented programming language developed by James Gosling and colleagues at Sun Microsystems in the early 1...
, are manifestly typed. Complete type inference has traditionally been associated with less mainstream languages, such as HaskellHaskell (programming language)

Haskell is a standardized pure functional programming language with non-strict semantics, named after the logician Haskell C...
 and MLML programming language

ML is a general-purpose functional programming language developed by Robin Milner and others in the late 1970s at the Univer...
. However, many manifestly typed languages support partial type inference; for example, JavaJava (programming language)

Java is an object-oriented programming language developed by James Gosling and colleagues at Sun Microsystems in the early 1...
 and C# both infer types in certain limited cases.
Dynamic typing, also called latent typing, determines the type-safety of operations at runtime; in other words, types are associated with runtime values rather than textual expressions. As with type-inferred languages, dynamically typed languages do not require the programmer to write explicit type annotations on expressions. Among other things, this may permit a single variable to refer to values of different types at different points in the program execution. However, type errors cannot be automatically detected until a piece of code is actually executed, making debugging more difficult. RubyRuby (programming language)

Ruby is a reflective, object-oriented programming language....
, LispLisp programming language

Lisp is a family of computer programming languages with a long history and a distinctive fully-parenthesized syntax....
, JavaScriptJavaScript

JavaScript is the name of Netscape Communications Corporation's implementation of ECMAScript, a scripting programming langua...
, and PythonPython (programming language)

Python is a programming language created by Guido van Rossum in 1990....
 are dynamically typed.
Weak and strong typing
Weak typing allows a value of one type to be treated as another, for example treating a string as a number. This can occasionally be useful, but it can also allow some kinds of program faults to go undetected at compile timeCompile time

In computer science, compile time, as opposed to runtime, is the time when a compiler compiles code written in a programming...
 and even at run timeRun time

*Run time: In the movie and television industry "run time" is the length of the film or programme in minutes....
.

Strong typing prevents the above. An attempt to perform an operation on the wrong type of value raises an error. Strongly-typed languages are often termed type-safe or safeFacts About Type safety

In computer science, type safety is a property attributed to some, but not all, programming languages....
.

An alternative definition for "weakly typed" refers to languages, such as PerlPerl Summary

Perl, also Practical Extraction and Report Language is a dynamic procedural programming language designed by Larry Wa...
, JavaScriptJavaScript

JavaScript is the name of Netscape Communications Corporation's implementation of ECMAScript, a scripting programming langua...
, and C++C++

C++ is a general-purpose, high-level programming language with low-level facilities....
, which permit a large number of implicit type conversions. In JavaScript, for example, the expression 2 * x implicitly converts x to a number, and this conversion succeeds even if x is null, undefined, an Array, or a string of letters. Such implicit conversions are often useful, but they can mask programming errors.

Strong and static are now generally considered orthogonal concepts, but usage in the literature differs. Some use the term strongly typed to mean strongly, statically typed, or, even more confusingly, to mean simply statically typed. Thus CFacts About C (programming language)

The C programming language is a general-purpose, procedural, imperative computer programming language developed in the earl...
 has been called both strongly typed and weakly, statically typed.

Execution semantics

Once data has been specified, the machine must be instructed to perform operations on the data. The execution semantics of a language defines how and when the various constructs of a language should produce a program behavior.

For example, the semantics may define the strategyEvaluation strategy

An evaluation strategy for a programming language is a set of rules for defining the evaluation of expressions under ß-reduc...
 by which expressions are evaluated to values, or the manner in which control structures conditionally execute statements.

Core library


Most programming languages have an associated core libraryLibrary (computer science)

In computer science, a library is a collection of subprograms used to develop software....
 (sometimes known as the 'Standard library', especially if it is included as part of the published language standard), which is conventionally made available by all implementations of the language. Core libraries typically include definitions for commonly used algorithms, data structures, and mechanisms for input and output.

A language's core library is often treated as part of the language by its users, although the designers may have treated it as a separate entity. Many language specifications define a core that must be made available in all implementations, and in the case of standardized languages this core library may be required. The line between a language and its core library therefore differs from language to language. Indeed, some languages are designed so that the meanings of certain syntactic constructs cannot even be described without referring to the core library. For example, in JavaJava (programming language)

Java is an object-oriented programming language developed by James Gosling and colleagues at Sun Microsystems in the early 1...
, a string literal is defined as an instance of the java.lang.String class; similarly, in SmalltalkSmalltalk

Smalltalk is an object-oriented, dynamically typed, reflective programming language....
, an anonymous functionAnonymous function

An anonymous function is a function defined, and possibly called, without being bound to a name....
 expression (a "block") constructs an instance of the library's BlockContext class. Conversely, Scheme contains multiple coherent subsets that suffice to construct the rest of the language as library macros, and so the language designers do not even bother to say which portions of the language must be implemented as language constructs, and which must be implemented as parts of a library.

Practice

A language's designers and users must construct a number of artifacts that govern and enable the practice of programming. The most important of these artifacts are the language specification and implementation.

Specification

The specification of a programming language is intended to provide a definition that the language userProgrammer

A programmer or software developer is someone who programs computers, that is, one who writes computer software....
s and the implementorsProgramming language implementation

A programming language implementation is a system for executing programs written in a programming language....
 can use to determine whether the behavior of a programComputer program

Most computer programs consist of a list of instructions that explicitly implement an algorithm , another form of computer ...
 is correct, given its source codeSource code

Source code is any series of statements written in some human-readable computer programming language....
.

A programming language specification can take several forms, including the following:

  • An explicit definition of the syntax, static semantics, and execution semantics of the language. While syntax is commonly specified using a formal grammar, semantic definitions may be written in natural languageNatural language

    The term natural language is used to distinguish languages spoken and signed by humans for general-purpose communication fr...
     (e.g., the C languageC (programming language)

    The C programming language is a general-purpose, procedural, imperative computer programming language developed in the earl...
    ), or a formal semanticsFormal semantics of programming languages

    In theoretical computer science, formal semantics is the field concerned with the rigorous mathematical study of the meaning...
     (e.g., the Standard MLStandard ML

    Standard ML is a general-purpose, modular, functional programming language with compile-time type checking and type inferenc...
     and Scheme specifications).
  • A description of the behavior of a translatorCompiler Overview

    A compiler is a computer program that translates text written in a computer language into another computer language ....
     for the language (e.g., the C++C++

    C++ is a general-purpose, high-level programming language with low-level facilities....
     and FortranFortran Summary

    FORTRAN is a general-purpose, procedural, imperative programming language that is especially suited to numeric computation a...
     specifications). The syntax and semantics of the language have to be inferred from this description, which may be written in natural or a formal language.
  • A reference or model implementation, sometimes written in the language being specified (e.g., PrologProlog

    Prolog is a logic programming language....
     or ANSI REXXREXX

    REXX is an interpreted programming language which was developed at IBM....
    ). The syntax and semantics of the language are explicit in the behavior of the reference implementation.

Implementation

An implementation of a programming language provides a way to execute that program on one or more configurations of hardware and software. There are, broadly, two approaches to programming language implementation: compilationCompiler

A compiler is a computer program that translates text written in a computer language into another computer language ....
and interpretationInterpreter (computing)

An interpreter is a computer program that executes other programs....
. It is generally possible to implement a language using either technique.

The output of a compilerCompiler

A compiler is a computer program that translates text written in a computer language into another computer language ....
 may be executed by hardware or a program called an interpreter. In some implementations that make use of the interpreter approach there is no distinct boundary between compiling and interpreting. For instance, some implementations of the BASIC programming language compile and then execute the source a line at a time.

Programs that are executed directly on the hardware usually run several orders of magnitude faster than those that are interpreted in software.

One technique for improving the performance of interpreted programs is just-in-time compilationJust-in-time compilation

In computing, just-in-time compilation, also known as dynamic translation, is a technique for improving the performanc...
. Here the virtual machineVirtual machine

In computer science, a virtual machine is software that creates a virtualized environment between the computer platform so t...
, just before execution, translates the blocks of bytecodeBytecode

Bytecode is an intermediate code more abstract than machine code....
 which are going to be used to machine code, for direct execution on the hardware.

History


Early developments

The first programming languages predate the modern computer. The 19th century had "programmable" loomLoom

A loom is a machine or device for weaving thread or yarn into textiles....
s and player pianoPlayer piano Summary

The player piano is a type of piano that plays music automatically without the need for a human pianist....
 scrolls which implemented what are today recognized as examples of domain-specific programming languageDomain-specific programming language

A domain-specific programming language is a programming language designed to be useful for a specific set of tasks....
s. By the beginning of the twentieth century, punch cards encoded data and directed mechanical processing. In the 1930s and 1940s, the formalisms of Alonzo ChurchAlonzo Church

Alonzo Church was an American mathematician and logician who was responsible for some of the foundations of theoretical com...
's lambda calculusLambda calculus

In mathematical logic and computer science, lambda calculus, also ?-calculus, is a formal system designed to investiga...
 and Alan TuringAlan Turing

Alan Mathison Turing, OBE , was an English mathematician, logician, and cryptographer....
's Turing machineTuring machine

Turing machines are extremely basic symbol-manipulating devices which despite their simplicity can be adapted to simulate ...
s provided mathematical abstractions for expressing algorithmAlgorithm

In mathematics and computing, an algorithm is a procedure for accomplishing some task which, given an initial state, will t...
s; the lambda calculus remains influential in language design.

In the 1940s, the first electrically powered digital computers were created. The first high-levelHigh-level programming language

A high-level programming language is a programming language that, in comparison to low-level programming languages, may be m...
 programming language to be designed for a computer was PlankalkülPlankalkül

Plankalkl is a computer language developed for engineering purposes by Konrad Zuse....
, developed for the GermanGermany

Germany , officially the Federal Republic of Germany , is a country in central Europe....
 Z3 by Konrad ZuseKonrad Zuse

Konrad Zuse was a German engineer and computer pioneer....
 between 1943 and 1945.

The computers of the early 1950s, notably the UNIVAC IUNIVAC I

The UNIVAC I ' was the first commercial computer made in the United States, and the third commercial computer worldwide....
 and the IBM 701IBM 701 Overview

The IBM 701, known as the Defense Calculator while in development, was announced to the public on April 29, 1952, and ...
 used machine language programsMachine code

Machine code or machine language is a system of instructions and data directly understandable by a computer's central ...
. First generationFirst-generation programming language

A first-generation programming language is a machine-level programming language....
 machine language programming was quickly superseded by a second generationSecond-generation programming language

A second-generation programming language is a term usually used to refer to some form of assembly language....
 of programming languages known as Assembly languageAssembly language

Assembly language refers to a class of low-level languages used to write computer programs, or to a particular such language...
s. Later in the 1950s, assembly language programming, which had evolved to include the use of macro instructionMacro instruction

A macro instruction is a line of computer program coding that results in one or more lines of program coding in the target p...
s, was followed by the development of three higher-level programming languages: FORTRANFortran

FORTRAN is a general-purpose, procedural, imperative programming language that is especially suited to numeric computation a...
, LISPLisp programming language

Lisp is a family of computer programming languages with a long history and a distinctive fully-parenthesized syntax....
, and COBOLCOBOL

COBOL is a third-generation programming language, and one of the oldest programming languages still in active use....
. Updated versions of all of these are still in general use, and each has strongly influenced the development of later languages. At the end of the 1950s, the language formalized as Algol 60 was introduced, and most later programming languages are, in many respects, descendants of Algol. The format and use of the early programming languages was heavily influenced by the constraints of the interfaceComputer programming in the punch card era

From the invention of computer programming languages until roughly the mid-1970s, most computer programmers created, edited and st...
.

Refinement


The period from the 1960s to the late 1970s brought the development of the major language paradigms now in use, though many aspects were refinements of ideas in the very first Third-generation programming languageThird-generation programming language

A third generation language is a programming language designed to be easier for a human to understand, including things like...
s:
  • APL introduced array programmingArray programming

    Array programming languages generalize operations on scalars to apply transparently to vectors, matrices, and higher dimensi...
    and influenced functional programmingFunctional programming

    Functional programming is a programming paradigm that conceives computation as the evaluation of mathematical functions and ...
    .
  • PL/IPL/I

    PL/I is an imperative computer programming language designed for scientific, engineering, and business applications....
     (NPL) was designed in the early 1960s to incorporate the best ideas from FORTRAN and COBOL.
  • In the 1960s, Simula was the first language designed to support object-oriented programmingObject-oriented programming

    In computer science, object-oriented programming is a computer programming paradigm....
    ; in the mid-1970s, Smalltalk followed with the first "purely" object-oriented language.
  • CC (programming language)

    The C programming language is a general-purpose, procedural, imperative computer programming language developed in the earl...
     was developed between 1969 and 1973 as a systems programming language, and remains popular.
  • Prolog, designed in 1972, was the first logic programmingLogic programming

    Logic programming is programming that makes use of pattern-directed invocation of procedures from assertions and goals....
    language.
  • In 1978, MLML programming language

    ML is a general-purpose functional programming language developed by Robin Milner and others in the late 1970s at the Univer...
     built a polymorphic type system on top of Lisp, pioneering statically typed functional programmingFunctional programming

    Functional programming is a programming paradigm that conceives computation as the evaluation of mathematical functions and ...
    languages.

Each of these languages spawned an entire family of descendants, and most modern languages count at least one of them in their ancestry.

The 1960s and 1970s also saw considerable debate over the merits of structured programmingStructured programming

Structured programming can be seen as a subset or subdiscipline of procedural programming, one of the major programming para...
, and whether programming languages should be designed to support it. Edsger Dijkstra, in a famous 1968 letter published in the Communications of the ACMCommunications of the ACM

Communications of the ACM is the flagship monthly magazine of the Association for Computing Machinery....
, argued that GOTOGOTO Overview

GOTO is a statement found in many programming languages that instructs the computer to jump to another point in the computer...
 statements should be eliminated from all "higher level" programming languages.

The 1960s and 1970s also saw expansion of techniques that reduced the footprint of a program as well as improved productivity of the programmer and user. The card deckComputer programming in the punch card era

From the invention of computer programming languages until roughly the mid-1970s, most computer programmers created, edited and st...
 for an early 4GLFourth-generation programming language Overview

A fourth-generation programming language is a programming language designed with a specific purpose in mind, such as the de...
 was a lot smaller for the same functionality expressed in a 3GL deckThird-generation programming language

A third generation language is a programming language designed to be easier for a human to understand, including things like...
.

Consolidation and growth


The 1980s were years of relative consolidation. C++ combined object-oriented and systems programming. The United States government standardized Ada, a systems programming language intended for use by defense contractors. In Japan and elsewhere, vast sums were spent investigating so-called "fifth generation" languagesFifth generation computer

The Fifth Generation Computer Systems project was an initiative by Japan's...
 that incorporated logic programming constructs. The functional languages community moved to standardize ML and Lisp. Rather than inventing new paradigms, all of these movements elaborated upon the ideas invented in the previous decade.

One important trend in language design during the 1980s was an increased focus on programming for large-scale systems through the use of modules, or large-scale organizational units of code. Modula-2Modula-2

Modula-2 is a computer programming language invented by Niklaus Wirth at ETH around 1978, as a successor to Modula, an inter...
, Ada, and ML all developed notable module systems in the 1980s, although other languages, such as PL/IFacts About PL/I

PL/I is an imperative computer programming language designed for scientific, engineering, and business applications....
, already had extensive support for modular programming. Module systems were often wedded to generic programmingGeneric programming

Generic programming is a datatype-independent way of computer programming....
 constructs.

The rapid growth of the InternetInternet

The Internet is the worldwide, publicly accessible network of interconnected computer networks that transmit data by packet ...
 in the mid-1990's created opportunities for new languages. PerlPerl

Perl, also Practical Extraction and Report Language is a dynamic procedural programming language designed by Larry Wa...
, originally a Unix scripting tool first released in 1987, became common in dynamic Web sites. JavaJava (programming language)

Java is an object-oriented programming language developed by James Gosling and colleagues at Sun Microsystems in the early 1...
 came to be used for server-side programming. These developments were not fundamentally novel, rather they were refinements to existing languages and paradigms, and largely based on the C family of programming languages.

Programming language evolution continues, in both industry and research. Current directions include security and reliability verification, new kinds of modularity|delegates]], aspectsAspect-oriented programming

In software engineering, the programming paradigms of aspect-oriented programming, and aspect-oriented software developme...
), and database integration.

The 4GLs are examples of languages which are domain-specific, such as SQLSQL

SQL is the most popular computer language used to create, modify, retrieve and manipulate data from relational database man...
, which manipulates and returns setSet

In mathematics, a set can be thought of as any collection of distinct things considered as a whole....
s of data rather than the scalar values which are canonical to most programming languages. PerlPerl

Perl, also Practical Extraction and Report Language is a dynamic procedural programming language designed by Larry Wa...
, for example, with its 'here document' can hold multiple 4GL programs, as well as multiple JavaScript programs, in part of its own perl code and use variable interpolation in the 'here document' to support multi-language programming.

Taxonomies

There is no overarching classification scheme for programming languages. A given programming language does not usually have a single ancestor language. Languages commonly arise by combining the elements of several predecessor languages with new ideas in circulation at the time. Ideas that originate in one language will diffuse throughout a family of related languages, and then leap suddenly across familial gaps to appear in an entirely different family.

The task is further complicated by the fact that languages can be classified along multiple axes. For example, Java is both an object-oriented language (because it encourages object-oriented organization) and a concurrent language (because it contains built-in constructs for running multiple threadsThread (computer science)

A thread in computer science is short for a thread of execution....
 in parallel). PythonPython (programming language)

Python is a programming language created by Guido van Rossum in 1990....
 is an object-oriented scripting languageScripting language

Scripting languages are computer programming languages created to shorten the traditional edit-compile-link-run process....
.

In broad strokes, programming languages divide into programming paradigmProgramming paradigm

A programming paradigm is a paradigmatic style of programming....
s
and a classification by intended domain of use. Paradigms include procedural programmingFacts About Procedural programming

Procedural programming is sometimes used as a synonym for imperative programming , but can also refer to a programming para...
, object-oriented programmingObject-oriented programming

In computer science, object-oriented programming is a computer programming paradigm....
, functional programmingFunctional programming

Functional programming is a programming paradigm that conceives computation as the evaluation of mathematical functions and ...
, and logic programmingLogic programming

Logic programming is programming that makes use of pattern-directed invocation of procedures from assertions and goals....
; some languages are hybrids of paradigms or multi-paradigmatic. An assembly languageAssembly language

Assembly language refers to a class of low-level languages used to write computer programs, or to a particular such language...
 is not so much a paradigm as a direct model of an underlying machine architecture. By purpose, programming languages might be considered general purpose, system programming languages, scripting languages, domain-specific languages, or concurrent/distributed languages (or a combination of these). Some general purpose languages were designed largely with educational goals.

A programming language may also be classified by factors unrelated to programming paradigm. For instance, most programming languages use English languageFacts About English language

English is a widely distributed language that originated in England but is now the primary language in numerous countries....
 keywords, while a minority do notCategorical list of programming languages

This is a list of programming languages grouped by category....
. Other languages may be classified as being esotericEsoteric programming language

An esoteric programming language is a programming language designed as a test of the boundaries of computer programming lan...
 or not.

See also

  • Lists of programming languages
  • Comparison of programming languagesComparison of programming languages

    Programming languages are used for controlling the behavior of a machine....
  • Comparison of basic instructions of programming languages
  • Educational programming languageEducational programming language

    An educational programming language is a programming language that is designed primarily as a learning instrument and not s...
  • Invariant based programmingInvariant Based Programming

    Invariant based programming is a programming methodology where specifications and invariants are written before the actual p...
  • Literate programmingLiterate programming

    Literate programming is the writing of computer programs primarily for human beings to read, similar to a work of literature...
  • Programming language dialectProgramming language dialect

    A dialect of a programming language is a variation or extension of the language that does not change its intrinsic nature....
  • Programming language theoryProgramming language theory

    Programming language theory is a branch of computer science which deals with the design, implementation, analysis, character...
  • Computer scienceComputer science

    Computer science, or computing science, is the study of the theoretical foundations of information and computation and...
     and List of basic computer science topicsList of basic computer science topics

    Basic topics in computer science include:...
  • Software engineeringSoftware engineering

    Software Engineering is the discipline of designing, creating, and maintaining software by applying technologies and practi...
     and List of software engineering topicsList of software engineering topics Summary

    This list complements the software engineering article, giving more details and examples....


Further reading

  • Daniel P. Friedman, Mitchell Wand, Christopher Thomas Haynes: Essentials of Programming Languages, The MIT Press 2001.
  • David Gelernter, Suresh Jagannathan: Programming Linguistics, The MIT Press 1990.
  • Shriram Krishnamurthi: Programming Languages: Application and Interpretation, .
  • Bruce J. MacLennan: Principles of Programming Languages: Design, Evaluation, and Implementation, Oxford University Press 1999.
  • John C. Mitchell: Concepts in Programming Languages, Cambridge University Press 2002.
  • Benjamin C. Pierce: Types and Programming Languages, The MIT Press 2002.
  • Ravi Sethi: Programming Languages: Concepts and Constructs, 2nd ed., Addison-Wesley 1996.
  • Michael L. Scott: Programming Language Pragmatics, Morgan Kaufmann Publishers 2005.
  • Richard L. Wexelblat (ed.): History of Programming Languages, Academic Press 1981.

External links

  • A collection of implementations in many languages.
  • by Peter Grogono
  • , a community weblog for professional discussion and repository of documents on programming language theoryProgramming language theory

    Programming language theory is a branch of computer science which deals with the design, implementation, analysis, character...
    .
  • , rough programming language popularity statistics].