Pages

Advertisement

Friday, July 6, 2007

Elements in Programming

Syntax:

Parse tree of Python code with inset tokenization
Parse tree of Python code with inset tokenization
Syntax highlighting is often used to aid programmers in the recognition of elements of source code. The language you see here is Python
Syntax highlighting is often used to aid programmers in the recognition of elements of source code. The language you see here is Python

A programming language's surface form is known as its syntax. 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 graphical 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. Since most languages are textual, this article discusses textual syntax.

Programming language syntax is usually defined using a combination of regular expressions (for lexical structure) and Backus-Naur Form (for grammatical structure). Below is a simple grammar, based on Lisp:

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 language 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 furiously." 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 hierarchy. The syntax of most programming languages can be specified using a Type-2 grammar, ie, they are context-free grammars.[11]

Type system

For more details on this topic, see Type system.
For more details on this topic, see Type safety.

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 structures that can be constructed in the language. The design and study of type systems using formal mathematics is known as type theory.

Internally, all data in modern digital computers are stored simply as zeros or ones (binary). The data typically represent information in the real world such as names, bank accounts and measurements, so the low-level binary data are organized by programming languages into these high-level concepts as data types. There are also more abstract types whose purpose is just to warn the programmer about semantically meaningless statements or verify safety properties of programs.

Most languages can be classified with respect to their type systems, though some such as Visual Basic allow the programmer to choose the system employed.

Typed vs untyped languages

A language is typed if operations defined for one data type cannot be performed on values of another data type.[12] 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 exception.

A special case of typed languages are the single-type languages. These are often scripting or markup languages, such as Rexx 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 languages, allows any operation to be performed on any data, which are generally considered to be sequences of bits of various lengths.[12] High-level languages which are untyped include BCPL and some varieties of Forth.

In practice, while few languages are considered typed from the point of view of type theory (verifying or rejecting all operations), most modern languages offer a degree of typing.[12] Many production languages provide means to bypass or subvert the type system.

Static vs 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.[12]

Statically-typed languages can be manifestly typed or type-inferred. In the first case, the programmer must explicitly write types at certain textual positions (for example, at variable declarations). In the second case, the compiler infers the types of expressions and declarations based on context. Most mainstream statically-typed languages, such as C++ and Java, are manifestly typed. Complete type inference has traditionally been associated with less mainstream languages, such as Haskell and ML. However, many manifestly typed languages support partial type inference; for example, Java and C# both infer types in certain limited cases.[13] 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.[12] 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. Ruby, Lisp, JavaScript, and Python 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.[12] This can occasionally be useful, but it can also allow some kinds of program faults to go undetected at compile time.

Strong typing prevents the above. Attempting to mix types raises an error.[12] Strongly-typed languages are often termed type-safe or safe, type safety can prevent particular kinds of program faults occurring (because constructs containing them are flagged at compile time).

An alternative definition for "weakly typed" refers to languages, such as Perl, JavaScript, and C++ which permit a large number of implicit type conversions; Perl in particular can be characterized as a dynamically typed programming language in which type checking can take place at runtime. See type system. This capability is often useful, but occasionally dangerous; as it would permit operations whose objects can change type on demand.

Strong and static are 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 C has been called both strongly typed and weakly, statically typed.[14][15].

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 strategy by which expressions are evaluated to values, or the manner in which control structures conditionally execute statements.

Core library

For more details on this topic, see Standard library.

Most programming languages have an associated core library (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 Java, a string literal is defined as an instance of the java.lang.String class; similarly, in Smalltalk, an anonymous function 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.

Purpose of Programming

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, computers do exactly what they are told to do, and cannot understand the code the programmer "intended" to write. The combination of the language definition, the program, 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.[7] 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 microcontrollers to supercomputers.
  • 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 abstraction. 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 removed from simple translation into underlying hardware instructions. Because programmers are less tied to the needs of the computer, their programs can do more computing with less effort from the programmer. This lets them write more programs in the same amount of time.[8]

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 Dijkstra 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."[9] Alan Perlis was similarly dismissive of the idea.[10]

Definition of programming

Traits often considered important when deciding whether a language is a programming language:

* Function: A programming language is a language used to write computer programs, which involve a computer performing some kind of computation[3] or algorithm and possibly control external devices such as printers, robots[4], and so on.

* Target: Programming languages differ from natural languages 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 PostScript programs are frequently created by another program to control a computer printer or display.

* Constructs: Programming languages may contain constructs for defining and manipulating data structures or controlling the flow of execution.

* Expressive power: The theory of computation classifies languages by the computations they can express (see Chomsky hierarchy). All Turing complete languages can implement the same set of algorithms. ANSI/ISO SQL and Charity are examples of languages that are not Turing complete yet often called programming languages.[5][6]

Non-computational languages, such as markup languages like HTML or formal grammars like BNF, are usually not considered programming languages. Often a programming language is embedded in the non-computational (host) language.

What is Programming ?


A programming language is an artificial language that can be used to control the behavior of a machine, particularly a computer. Programming languages, like human languages, are defined through the use of syntactic and semantic rules, to determine structure and meaning respectively.Programming languages are used to facilitate communication about the task of organizing and manipulating information, and to express algorithms precisely. Some authors restrict the term "programming language" to those languages that can express all possible algorithms;[1] sometimes the term "computer language" is used for more limited artificial languages.

Programming Languages

Array languages

See also: :Category:Array_programming_languages

Array programming (also known as vector or multidimensional languages) generalize operations on scalars to apply transparently to vectors, matrices, and higher dimensional arrays.

* A+
* Analytica
* APL
* F
* FISh
* Fortran 90 and later versions
* IDL
* J
* K
* MATLAB
* Octave
* NESL
* Nial
* PDL
* ZPL
* SAC

Aspect-oriented languages

* AspectC++
* AspectJ
* CaesarJ
* Common Lisp
* Compose*
* JAsCo (and AWED)
* ObjectTeams

Assembly languages

See also: :Category:Assembly languages

Assembly languages directly correspond to a machine language (see below) in order to allow machine code instructions to be written in a form understandable by humans. Assembly languages allow programmers to use symbolic addresses which are later converted to absolute addresses by the assembler. Most assemblers also allow for macros and symbolic constants.

* ASEM-51 [1]
* a56 (for Motorola DSP56000 DSPs, DSP56k series)
* AKI (AvtoKod "Inzhener", "Engineer's Autocode" for Minsk family of computers)
* ASCENT (ASsembler for CENTral Processor Unit of Control Data Corporation computer systems pre-COMPASS)
* ASPER (ASsembler for PERipheral Processor Units of Control Data Corporation computer systems pre-COMPASS)
* BAL (Basic AssembLer) - for IBM System/360 and later mainframe systems
* C-- (name used by a few languages that bring C language closer to Assembly)
* COMPASS (COMPrehensive ASSembler)
* D (multiparadigm curly-brace language with built-in inline assembler)
* Emu8086 [2] (x86 assembler and Intel's 8086 microprocessor emulator)
* EDTASM (Microsoft editor/assembler for Motorola 6809 on the Color Computer)
* FAP (FORTRAN Assembly Program, for IBM 709, 7090, 7094 mainframes)
* FASM (Flat Assembler; IA-32, IA-64)
* GAS (GNU Assembler)
* HLA (High Level Assembly)
* HLASM (High Level Assembler, for mainframes)
* Linoleum (for cross platform use)
* MACRO-11 (for DEC PDP-11)
* MACRO-20 (for DEC DECSYSTEM-20)
* MACRO-32 (for DEC VAX)
* MASM (Microsoft Macro Assembler)
* MI (Machine Interface, compile-time intermediate language)
* MIPS ( for MIPS architecture) Microprocessor without Interlocked Pipeline Stages
* Motorolla 68k Assembly ( for Motorola 68k ) Assembly Language for Motorolla 68k family of CPUs
* NASM (Netwide Assembler)
* NEAT (National's Electronic Autocoder Technique), for NCR computers, evolved into NEAT/3
* PAL-III (for DEC PDP-8)
* PASM (for Parrot virtual machine)
* RosAsm (32 bit Assembler; The Bottom Up Assembler)
* Sphinx C-- (mixes Assembly commands with C-like structures)
* SSK (Sistema Simvolicheskogo Kodirovaniya, or "System of symbolic coding") for Minsk family of computers
* TASM (Turbo Assembler, Borland)

Authoring languages

* Bigwig (web design language)
* Coursewriter
* PILOT
* TUTOR

Command line interface languages

Command line interface (CLI) languages are also called batch languages, or job control languages. Examples:

* 4DOS (extended command-line shell for IBM PCs)
* bash (the "Bourne-Again" shell from GNU/FSF)
* Ch (C-compatible shell)
* CHAIN (Datapoint)
* CLIST (MVS Command List)
* csh (C-like shell from Bill Joy at UC Berkeley)
* DCL DIGITAL Command Language - standard CLI language for VMS (DEC, Compaq, HP)
* DOS batch language (standard CLI/batch language for the IBM PC running DR-DOS, MS-DOS, or PC-DOS before Windows)
o EA_QB_Command
* EXEC
* EXEC 2
* JCL (punch card-oriented batch control language for IBM/360 family mainframes)
* ksh (a standard Unix shell, written by David Korn)
* REXX
* sh (the standard Unix shell, written by Stephen Bourne)
* Winbatch (Windows batch file language)
* Windows PowerShell (Microsoft .NET-based CLI)
* zsh (a Unix shell)

Compiled languages

These are languages typically processed by compilers, though theoretically any language can be compiled or interpreted. See also compiled language.

* Ada (multi-purpose language)
* ALGOL (extremely influential language design. The second high level language compiler.)
o SMALL Machine Algol Like Language
* BASIC (some dialects, including the first version of Dartmouth BASIC)
* C (one of the most widely-used procedural programming languages)
* C++
* C# (compiled into Intermediate Language bytecode)
* CLEO (Clear Language for Expressing Orders) used the compiler for the British Leo computers
* CLush (Lush)
* COBOL
* Common Lisp
* Corn
* Curl
* D
* Delphi (Borland's Object Pascal development system)
* DIBOL (Digital Interactive Business Oriented Language)
* Eiffel (object-oriented language developed by Bertrand Meyer)
o Sather
o Ubercode
* Forth (professional systems, like VFX and SwiftForth)
* Fortran (the first high level, compiled, language, from IBM, John Backus, et al)
* Java (originally from Sun Microsystems; usually compiled into JVM bytecode although true native-code compiled versions exist)
* JOVIAL
* Nemerle (compiled into Intermediate Language bytecode)
* Objective-C
* Pascal (most implementations)
* ppC++
* Scheme (some implementations, e.g. Gambit)
* ML
o Standard ML
+ Alice
o Ocaml
* Turing
* Urq
* Visual Basic (from Microsoft)
* Visual Foxpro
* Visual Prolog
* WinDev

Concurrent languages

See also: :Category:Concurrent_programming_languages

Message passing languages provide language constructs for concurrency. The predominant paradigm for concurrency in mainstream languages such as Java is shared memory concurrency based on monitors. Concurrent languages that make use of message passing have generally been inspired by CSP or the π-calculus, but have had little commercial success, except for Ada and Erlang. Ada is a multipurpose language and concurrent programming is only one option available.

* Ada (multi-purpose language)
* Afnix – concurrent access to data is protected automatically (previously called Aleph, but unrelated to Alef)
* Alef – concurrent language with threads and message passing, used for systems programming in early versions of Plan 9 from Bell Labs
* ChucK – domain specific programming language for audio, precise control over concurrency and timing
* Cilk – a concurrent C
* Cω – C Omega, a research language extending C#, uses asynchronous communication
* Concurrent Pascal (by Brinch-Hansen)
* Corn
* Curry
* E – uses promises, ensures deadlocks cannot occur
* Eiffel (through the SCOOP mechanism, Simple Concurrent Object-Oriented Computation)
* Erlang – uses asynchronous message passing with nothing shared
* Java
o Join Java – concurrent language based on Java
o X10
* Join-calculus
* Joule – dataflow language, communicates by message passing
* Limbo – relative of Alef, used for systems programming in Inferno (operating system)
* MultiLisp – Scheme variant extended to support parallelism
* occam – influenced heavily by Communicating Sequential Processes (CSP).
o occam-π – a modern variant of occam, which incorporates ideas from Milner's π-calculus
* Oz – multiparadigm language, supports shared-state and message-passing concurrency, and futures
o Mozart Programming System – multiplatform Oz
* Pict – essentially an executable implementation of Milner's π-calculus
* SALSA – actor language with token-passing, join, and first-class continuations for distributed computing over the Internet
* SR – research language

Curly-bracket languages

See also: :Category:Curly bracket programming languages

The curly bracket programming languages have a syntax that defines statement blocks using the "curly bracket" or "brace" characters { and }. All these languages descend from or are strongly influenced by C. Examples of curly-bracket languages include:

* ABCL/c+
* Alef
o Limbo
* AutoHotkey
* AWK
* BCPL
* C - developed circa 1970 at Bell Labs
* C shell (csh)
* C++
* C#
* Ch - embeddable C/C++ interpreter
* ChucK - audio programming language
* Cilk - concurrent C for multithreaded parallel programming
* Coyote - safer C variant to lower the likelihood of some common errors, e.g., buffer overflows
* Cyclone - safer C variant
* D - C/C++ variant
* DINO
* E
* ECMAScript
o ActionScript
o DMDScript
o E4X
o JavaScript
o JScript
o MDMscript
* Frink
* ICI
* Java
o Groovy
o Join Java
o X10
* LPC
* Nemerle - combines C# and ML features, provides syntax extension capabilities
* Perl
* PHP
* Pico
* Pike
* ppC++
* Suneido
* SuperCollider
* TorqueScript
* UnrealScript
* Windows PowerShell (Microsoft .NET-based CLI)
* Yorick

Dataflow languages

Dataflow languages rely on a (usually visual) representation of the flow of data to specify the program. Frequently used for reacting to discrete events or for processing streams of data. Examples of dataflow languages include:

* Hartmann pipelines
* G (used in LabVIEW)
* Max
* Prograph
* Pure data
* VEE
* VisSim

Data-oriented languages

Data-oriented languages provide powerful ways of searching and manipulating the relations that have been described as entity relationship tables which map one set of things into other sets. Examples of data-oriented languages include:

* Clarion
* Clipper (programming language)
* dBase a relational database access language
* M (an ANSI standard general purpose language with specializations for database work.)
* SPARQL
* SQL
* Tutorial D, see also The Third Manifesto
* Visual Foxpro native rdbms engine, object oriented, functional, RAD
* WebQL

Data-structured languages

See also: :Category:Data-structured programming languages

Data-structured languages are those where logic is structured in ways similar to their data. Such languages are generally well suited to reflection and introspection. There are three main types:

* Array-based
* List-based
* Stack-based

Assembly languages which statically link data inline with instructions can also be considered data-structured, in the most primitive way.

Declarative languages

See also: :Category:Declarative programming languages

Declarative languages describe a problem rather than defining a solution. Declarative programming stands in contrast to imperative programming via imperative programming languages, where serial orders (imperatives) are given to a computer. In addition to the examples given just below, all (pure) functional and logic-based programming languages are also declarative. In fact, "functional" and "logical" constitute the usual subcategories of the declarative category.

* ABSET
* Analytica
* Lustre
* MetaPost
* Prolog
* SQL
* XSL Transformations

Esoteric languages

An esoteric programming language is a programming language designed as a test of the boundaries of computer programming language design, as a proof of concept, or as a joke.

* Befunge
* Brainfuck
* Chef
* FALSE
* INTERCAL
* Shakespeare
* Whitespace
* Malbolge
* Lolcode
* merd

Extension languages

Extension programming languages are languages intended to be embedded into another program and used to harness its features in extension scripts.

* AutoLISP (specific to AutoCAD)
* CAL
* Guile
* Visual Basic for Applications
* Lua

etc.)

* Python (Maya and other 3-D animation packages)
* REXX
* Tcl

Fourth-generation languages

Fourth-generation programming languages are high-level languages built around database systems. They are generally used in commercial environments.

* ABAP
* ADMINS
* BuildProfessional
* CorVision
* CSC's GraphTalk
* Easytrieve report generator (now CA-Easytrieve Plus)
* Focus
* GEMBASE
* Informix-4GL / Aubit-4GL
* LINC
* MAPPER (Unisys/Sperry) now part of BIS
* MARK-IV (Sterling/Informatics) now VISION:BUILDER of CA
* Oracle Express 4GL
* Revolution (not based on a database; still, the goal is to work at a higher level of abstraction than 3GLs)
* SAS
* Today
* Ubercode (VHLL, or very high level language)
* Uniface (programming language)
* Visual DataFlex
* Visual Foxpro

Functional languages

See also: :Category:Functional languages

Functional programming languages define programs and subroutines as mathematical functions. Many so-called functional languages are "impure", containing imperative features. Not surprisingly, many of these languages are tied to mathematical calculation tools. Functional languages include:

* APL
* Charity
* Clean (purely functional)
* CodeSimian
* Curl
* Curry
* Erlang
* F#
* Haskell (purely functional)
o CAL
* J
* Joy
* Kite
* Lisp
o Common Lisp
o Dylan
o Logo
o Scheme
* Lush
* Maple
* Mathematica
* ML
o Standard ML
+ Alice
o Ocaml
* Nemerle
* Opal
* OPS5
* Poplog
* Q
* REFAL
* Spreadsheets

Interactive mode languages

Interactive mode languages act as a kind of shell: expressions or statements can be entered one at a time, and the result of their evaluation is seen immediately.

* BASIC (some dialects)
* Forth
* Haskell (with the GHCi interpreter)
* M (an ANSI standard general purpose language)
* Maple
* ML
* Python
* Ruby (with irb)
* Tcl (with the Tcl shell, tclsh)
* Windows PowerShell (Microsoft .NET-based CLI)

Interpreted languages

Interpreted languages are programming languages which programs may be executed from source code form, by an interpreter.

* APL
* AutoIt scripting language
* BASIC (some dialects)
* CodeSimian
* Databus (later versions added optional compiling)
* Eiffel (via "Melting Ice Technology" in EiffelStudio)
* Forth (interactive shell only; otherwise compiled to native or threaded code)
* Frink
* J
* Lisp (early versions, pre-1962, and some experimental ones; production Lisp systems are compilers, but many of them still provide an interpreter if needed)
* Lua (programming language)
* Lush
* M (an ANSI standard general purpose language)
* Maple
* Pascal (early implementations)
* PostScript
* Python
* REXX
* Spin programming language
* The SDYPAIKSSVDAYSF Programming Language
* TorqueScript
* VBScript
* Windows PowerShell (Microsoft .NET-based CLI)
* Some scripting languages (below)

Iterative languages

Languages built around or offering generators

* Aldor
* Alphard
* CLU
* Eiffel, through "agents"
* Icon
* IPL-v
* Lua
* Lush
* Python
* Sather

List-based languages – LISPs

List-based languages are a type of data-structured language that are based upon the list data structure.

* Joy
* Lisp
o Common Lisp
o Arc
o CodeSimian (like Lisp, but made with Java)
o Dylan
o Scheme
o Logo
* Lush
* Tcl
* TRAC

Little languages

Little languages serve a specialized problem domain.

* apply is a domain-specific language for image processing on parallel and conventional architectures
* awk can serve as a prototyping language for C, because the syntax is similar
* SQL has only a few keywords, and not all the constructs needed for a full programming language

Logic-based languages

See also: :Category:Logic programming languages

Logic-based languages specify a set of attributes that a solution must have, rather than a set of steps to obtain a solution. Examples:

* ALF
* Curry
* Janus
* Leda
* Oz
o Mozart Programming System a multiplatform Oz
* Poplog
* Prolog (formulates data and the program evaluation mechanism as a special form of mathematical logic called Horn logic and a general proving mechanism called logical resolution)
o Mercury (based on Prolog)
o Strawberry Prolog (standard Prolog with some extensions)
o Visual Prolog (object-oriented Prolog extension)
* ROOP

Machine languages

Machine languages are directly executable by a computer's CPU. They are typically formulated as bit patterns, usually represented in octal or hexadecimal. Each group of npatterns (often 1 or more bytes) causes the circuits in the CPU to execute one of the fundamental operations of the hardware. The activation of specific electrical inputs (eg, CPU package pins for microprocessors), and logical settings for CPU state values, control the processor's computation. Individual machine languages are processor specific and are not portable. They are (essentially) always defined by the CPU developer, not by 3rd parties. The symbolic version, the processor's assembly language, is also defined by the developer, in most cases. Since processors come in families which are based on a shared architecture, the same basic assembly language style can often be used for more than one CPU. Each of the following CPUs served as the basis for a family of processors:

* ARM
* Intel 80x86
* IBM 360
* Intel 8008/8080/8085
* MIPS R2000|R3000
* MOS Tech 6502
* Motorola 680x
* Motorola 680x0
* National 32032
* Power Architecture - (POWER and PowerPC)
* StrongARM
* Sun SPARC, UltraSPARC

Macro languages

See also: :Category:Macro programming languages

Macro languages embed small pieces of executable code inside a piece of free-form text.

* C preprocessor
* m4 (originally from AT&T, bundled with Unix)
* PHP
* SMX
* Stage 2

Scripting languages such as Tcl and ECMAScript (ActionScript, DMDScript, E4X, JavaScript, JScript) have been embedded into applications so that they behave like macro languages.

Metaprogramming languages

Metaprogramming is writing of programs that write or manipulate other programs (or themselves) as their data or that do part of the work that is otherwise done at run time during compile time. In many cases, this allows programmers to get more done in the same amount of time as they would take to write all the code manually.

* Curl
* Forth
* Lisp
* Maude
* Nemerle
* Python

Multiparadigm languages

Multiparadigm languages support more than one programming paradigm. They allow a program to use more than one programming style. The goal is to allow programmers to use the best tool for a job, admitting that no one paradigm solves all problems in the easiest or most efficient way.

* Ada (concurrent, distributed, generic (template metaprogramming), imperative, object-oriented (class-based))
* ALF (functional, logic)
* APL (functional, imperative)
* BETA (functional, imperative, object-oriented (class-based))
* C++ (generic, imperative, object-oriented (class-based))
* ChucK (imperative, object-oriented, time-based, concurrent, on-the-fly)
* Common Lisp (functional, imperative, object-oriented (class-based), aspect-oriented (user may add further paradigms, e.g., logic))
* Corn (concurrent, generic, imperative, object-oriented (class-based))
* Curl (functional, imperative, object-oriented (class-based), metaprogramming)
* Curry (concurrent, functional, logic)
* D (generic, imperative, object-oriented (class-based))
* Dylan (functional, object-oriented (class-based))
* ECMAScript (functional, imperative, object-oriented (prototype-based))
o ActionScript
o DMDScript
o E4X
o JavaScript
o JScript
* Eiffel (imperative, object-oriented (class-based), generic)
* J (functional, imperative, object-oriented (class-based))
* LabVIEW (dataflow, visual)
* Lasso (macro, object-oriented (prototype-based), procedural, scripting)
* Lava (object-oriented (class-based), visual)
* Leda (functional, imperative, logic, object-oriented (class-based))
* Lua (functional, imperative, object-oriented (prototype-based))
* Maple
* Metaobject protocols (object-oriented (class-based, prototype-based))
* Nemerle (functional, object-oriented (class-based), imperative, metaprogramming)
* Objective Caml (functional, imperative, object-oriented (class-based))
* Oz (functional (evaluation: eager, lazy), logic, constraint, imperative, object-oriented (class-based), concurrent, distributed)
o Mozart Programming System (multiplatform Oz)
* Object Pascal (imperative, object-oriented (class-based))
* Perl (imperative, functional (can't be purely functional), object-oriented, class-oriented, aspect-oriented (through modules))
* PHP (imperative, object-oriented)
* Pliant (functional, imperative, object-oriented (class-based))
* Poplog (functional, imperative, logic)
* ppC++ (imperative, object-oriented (class-based))
* Prograph (dataflow, object-oriented (class-based), visual)
* Python (functional, object-oriented (class-based))
* REBOL (functional, object-oriented (prototype-based))
* ROOP (imperative, logic, object-oriented (class-based), rule-based)
* Ruby (functional, object-oriented (class-based))
* SISAL (concurrent, dataflow, functional)
* Spreadsheets (functional, visual)
* Tcl (functional, imperative, object-oriented (class-based))

Numerical analysis

* Algae
* Seneca an Oberon variant

Non-English-based languages

See also: :Category:Non-English-based programming languages

Non-English-based programming languages do not use English keywords.

* ARLOGO - Arabic
* Chinese BASIC - Chinese
* Fjölnir - Icelandic
* HPL - Hebrew
* Lexico - Spanish
* Rapira - Russian
* Glagol - Russian
* var'aq - Klingon

Object-oriented class-based languages

Class-based Object-oriented programming languages support objects defined by their class. Class definitions include member data. Polymorphic functions parameterized by the class of some of their arguments are typically called methods.

In languages with single dispatch, classes typically also include method definitions. In languages with multiple dispatch, methods are defined by generic functions. There are exceptions where single dispatch methods are generic functions (e.g. Bigloo's object system).

Multiple dispatch

* Common Lisp
* Dylan
* Goo
* Cecil

Single dispatch

* Actor
* Ada 95 (multi-purpose language)
* BETA
* C++
* C#
* Chrome
* ChucK
* ColdFusion
* Corn
* Curl
* D
* Delphi
* ECMAScript (originally from Sun and Netscape)
o ActionScript
o DMDScript
o E4X
o JavaScript
o JScript
o MDMscript
* Eiffel
o Sather
o Ubercode
* F-Script
* Fortran 2003
* Fortress
* J
* Java (closely related to C++, but with built-in garbage collection, removal of unsafe features and some advanced ones, compilation to universally runnable 'bytecode', protective sandbox for security -- originally from Sun Microsystems)
o Groovy
o Join Java
o X10
* Kite
* Lava
* Lua
* Modula-2 (data abstraction, information hiding, strong typing, full modularity -- from N Wirth)
o Modula-3 (added more object oriented features to Modula-2)
o Objective Modula-2 (Modula-2 with Smalltalk message passing, following the Objective-C object model)
* Moto
* Nemerle
* NetRexx
* Oberon-2 (full object orientation equivalence in an original, strongly typed, Wirthian manner)
* Object Pascal
* Object REXX
* Objective-C (a superset of C adding a Smalltalk derived object model and message passing syntax)
* Objective Caml
* Oz
o Mozart Programming System
* Perl 5
* PHP
* Pliant
* PowerBuilder
* ppC++
* Prograph
* Python (object oriented interpretive language)
* Revolution (programmer does not get to pick the objects)
* Ruby (object oriented interpretive language)
* Simula (the first object oriented language, from Norway)
* Smalltalk (pure object-orientation, originally from Xerox PARC)
o Bistro
o F-Script
o Little Smalltalk
o Squeak
o VisualAge
o VisualWorks
* SPIN
* SuperCollider
* VBScript (Microsoft Office 'macro scripting' language)
* Visual Basic
* Visual DataFlex
* Visual Foxpro
* Visual Prolog
* XOTcl

Object-oriented prototype-based languages

Prototype-based languages are object-oriented languages where the distinction between classes and instances have been removed:

* ABCL/1
* ABCL/R
* ABCL/R2
* ABCL/c plus
* ActionScript
* Agora
* Cecil
* CodeSimian
* ECMAScript
o ActionScript
o DMDScript
o E4X
o JavaScript (first named Mocha, then LiveScript)
o JScript
* Etoys in Squeak
* Io
* Lisaac
* MOO
* NewtonScript
* Maple
* Obliq
* REBOL
* Self (the first prototype-based language, derived from Smalltalk)
* Slate
* TADS

Off-side rule languages

Off-side rule languages are those where blocks are formed, indicated, by their indentation.

* ISWIM, the abstract language that introduced the rule
* ABC, Python's parent
o Python
* Miranda, Haskell's parent
o Haskell
+ Curry
* Occam
* Pliant
* SPIN

Procedural languages

Procedural programming languages are based on the concept of the unit and scope (the data viewing range of an executable code statement). A procedural program is composed of one or more units or modules, either user coded or provided in a code library; each module is composed of one or more procedures, also called a function, routine, subroutine, or method, depending on the language. Examples of procedural languages include:

* Ada (multi-purpose language)
* ALGOL (extremely influential language design. The second high level language compiler.)
o SMALL Machine Algol Like Language
* BASIC (BASICs are innocent of most modularity in (especially) versions prior to about 1990)
* BLISS
* C
* C++ (C with objects + much else)
* C# (from Microsoft, a next generation Java/C++ like language)
* ChucK (C/Java-like syntax, with new syntax elements for time and parallelism)
* ColdFusion
* COBOL
* Component Pascal (an Oberon-2 variant)
* Curl
* D
* Delphi
* ECMAScript
o ActionScript
o DMDScript
o E4X
o JavaScript (first named Mocha, then LiveScript)
o JScript
* Eiffel
* Fortran (better modularity in later Standards)
o F
* FPC Pascal (Pascal dialect)
* HyperTalk
* Java
o Groovy
o Join Java
* JOVIAL
* Lasso
* Modula-2 (fundamentally based on modules)
* Oberon-1 and Oberon-2 (improved, smaller, faster, safer follow-ons for Modula-2)
o Component Pascal
o Lagoona
o Seneca
* MATLAB
* M (more modular in its first release than a language of the time should have been; the standard has become still more modular since then)
* Nemerle
* Occam
* Pascal (successor to Algol60 and predecessor of Modula-2)
o Object Pascal
* Perl
* PL/C
* PL/I (large general purpose language, originally for IBM mainframes)
* Rapira
* VBScript
* Visual Basic
* Visual Foxpro

Reflective languages

Reflective languages let programs examine and possibly modify their high level structure at runtime. This is most common in high-level virtual machine programming languages like Smalltalk, and less common in lower-level programming languages like C. Languages and platforms supporting reflection:

* Aspect-oriented
* Befunge
* ChucK
* CodeSimian
* Curl
* ECMAScript
o ActionScript
o DMDScript
o E4X
o JavaScript
o JScript
* Eiffel
* Forth
* Java
o Java Virtual Machine
o Groovy
o Join Java
o X10
* Maple
* Lisp
o Common Lisp
o Dylan
o Logo
o Scheme
* Lua
* Maude system
* .NET Common Language Runtime
* Objective-C
* Objective Modula-2
* Perl
* PHP
* Pico
* Pliant
* Poplog
o POP-11
* Prolog
* Python
* REBOL
* Ruby
* Smalltalk (pure object-orientation, originally from Xerox PARC)
o Bistro
o F-Script
o Little Smalltalk
o Self
o Squeak
o VisualAge
o VisualWorks
* Snobol
* Tcl
o XOTcl

Rule-based languages

Rule-based languages instantiate rules when activated by conditions in a set of data. Of all possible activations, some set will be selected and the statements belonging to those rules will be executed. Examples of rule-based languages include:

* Clips
* Constraint Handling Rules
* Jess
* OPS5
* Prolog

Scripting languages

"Scripting language" has two apparently different, but in fact similar meanings. In a traditional sense, scripting languages are designed to automate frequently used tasks that usually involve calling or passing commands to external programs. Many complex application programs allow users to implement custom functions by providing them with built-in languages. Those which are of interpretive type, are often called scripting languages.

More recently many of these applications have chosen to "build in" traditional scripting languages, such as Perl or Visual Basic, but there are quite a few "native" scripting languages still in use. Many scripting languages are compiled to bytecode and then this (usually) platform independent bytecode is run through a virtual machine (compare to Java).

* AWK
* AppleScript
* BeanShell
* Ch (Embeddable C/C++ interpreter)
* CLIST
* ColdFusion
* ECMAScript
o ActionScript
o DMDScript
o E4X
o JavaScript (first named Mocha, then LiveScript)
o JScript
* EXEC
* EXEC 2
* F-Script
* Frink
* Game Maker Language (GML)
* ICI
* Io
* JASS
* Java
o Groovy
o Join Java
* Lua
* MAXScript
* MEL
* Mondrian
* Perl
* PHP (intended for Web servers)
* Python
* REXX
* Ruby
* Sed
* Tcl
* TorqueScript
* Revolution
* VBScript
* Windows PowerShell (Microsoft .NET-based CLI)
* Many shell command languages such as the UNIX shell or DCL on VMS have powerful scripting capabilities.

Stack-based languages

See also: :Category:Stack-oriented programming languages

Stack-based languages are a type of data-structured language that are based upon the stack data structure.

* colorForth
* Forth
* Factor
* Poplog via its implementation language POP-11
* PostScript
* RPL
* Urq

Synchronous languages

See also: :Category:Synchronous programming languages

Synchronous programming languages are optimized for programming reactive systems, systems that are often interrupted and must respond quickly. Many such systems are also called realtime systems, and are found often in embedded uses. Examples:

* Argos
* Averest
* Esterel
* LEA
* Lustre
* Signal
* SyncCharts

Syntax handling languages

* GNU bison (FSF's version of Yacc)
* GNU Flex (FSF's version of Lex)
* Lex (Lexical analysis, from Bell Labs)
* M4
* yacc (yet another compiler compiler, from Bell Labs)
* javacc
* Coco/R (EBNF with semantics)

Visual languages

See also: :Category:Visual programming languages

Visual programming languages let users specify programs in a two-(or more)-dimensional way, instead of as one-dimensional text strings, via graphic layouts of various types.

* CODE
* Eiffel (program design from BON or UML diagrams, with back-and-forth facilities (round-trip engineering) through EiffelStudio)
* Fabrik
* Hyperpascal
* LabVIEW
* Lava
* Limnor
* Mindscript — software visualization and development environment, open source
* Max
* Pict
* Prograph
* Pure Data
* Quartz Composer
* Simulink
* Spreadsheets
* Subtext
* Tinkertoy
* VEE
* VisSim
* VVVV

Some dataflow languages are also visual languages.

Wirth languages

Computer scientist Niklaus Wirth designed and implemented several influential languages.

* Algol W
* Modula
* Modula-2 (and Modula 3, etc. variants)
o Obliq Modula 3 variant
* Oberon (Oberon and Oberon-2)
o Component Pascal
o Lagoona
o Seneca
* Pascal
o Object Pascal (original name for Borland Delphi language)

XML-based languages

These are languages based on or that operate on XML. Although the big-boy equivalents of Oracle/PostgreSQL/MSSQL don't yet exist for XML, there are languages to navigate through it and its more tree-oriented structure.

* ECMAScript E4X
* Jelly
* XPath
* XQuery
* XSLT
* Cω