In
computer programming
Computer programming or coding is the composition of sequences of instructions, called computer program, programs, that computers can follow to perform tasks. It involves designing and implementing algorithms, step-by-step specifications of proc ...
, a free-form language is a
programming language
A programming language is a system of notation for writing computer programs.
Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
in which the positioning of
characters on the page in program text is insignificant. Program text does not need to be placed in specific columns as on old
punched card
A punched card (also punch card or punched-card) is a stiff paper-based medium used to store digital information via the presence or absence of holes in predefined positions. Developed over the 18th to 20th centuries, punched cards were widel ...
systems, and frequently ends of lines are insignificant.
Whitespace character
A whitespace character is a character data element that represents white space when text is
rendered for display by a computer.
For example, a ''space'' character (, ASCII 32) represents blank space such as a word divider in a Western scrip ...
s are used only to delimit
tokens, and have no other significance. Free-form languages allow a greater degree of flexibility and have fewer syntactic rules to learn, which could lower the entry barrier for beginners.
Most free-form languages descend from
ALGOL
ALGOL (; short for "Algorithmic Language") is a family of imperative computer programming languages originally developed in 1958. ALGOL heavily influenced many other languages and was the standard method for algorithm description used by the ...
, including
C,
Pascal, and
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language".
Perl was developed ...
.
Lisp
Lisp (historically LISP, an abbreviation of "list processing") is a family of programming languages with a long history and a distinctive, fully parenthesized Polish notation#Explanation, prefix notation.
Originally specified in the late 1950s, ...
languages are free-form, although they do not descend from ALGOL.
Rexx
Rexx (restructured extended executor) is a high-level programming language developed at IBM by Mike Cowlishaw. Both proprietary and open-source software, open source Rexx interpreter (computing), interpreters exist for a wide range of comput ...
and its dialects
ooRexx
Object REXX is a High-level programming language, high-level, General-purpose programming language, general-purpose, Interpreter (computing), interpreted, Object-oriented programming, object-oriented (Class-based programming, class-based) program ...
and
NetRexx
NetRexx is an open source, originally IBM's, variant of the REXX programming language to run on the Java virtual machine. It supports a classic REXX syntax, with no reserved keywords, along with considerable additions to support object-oriented pr ...
are mostly free-form, though in some cases whitespace characters are
concatenation
In formal language theory and computer programming, string concatenation is the operation of joining character strings end-to-end. For example, the concatenation of "snow" and "ball" is "snowball". In certain formalizations of concatenati ...
operators.
SQL
Structured Query Language (SQL) (pronounced ''S-Q-L''; or alternatively as "sequel")
is a domain-specific language used to manage data, especially in a relational database management system (RDBMS). It is particularly useful in handling s ...
, though not a full programming language, is also free-form.
Most free-form languages are also
structured programming Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making specific disciplined use of the structured control flow constructs of selection ( if/then/else) and repet ...
languages, which is sometimes thought to go along with the free-form syntax: Earlier
imperative programming
In computer science, imperative programming is a programming paradigm of software that uses Statement (computer science), statements that change a program's state (computer science), state. In much the same way that the imperative mood in natural ...
languages such as
Fortran 77 used particular columns for line numbers, which many structured languages do not use or need.
Structured languages exist which are not free-form, such as
ABC,
Curry
Curry is a dish with a sauce or gravy seasoned with spices, mainly derived from the interchange of Indian cuisine with European taste in food, starting with the Portuguese, followed by the Dutch and British, and then thoroughly internatio ...
,
Haskell
Haskell () is a general-purpose, statically typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research, and industrial applications, Haskell pioneered several programming language ...
,
Python and others. Many of these use some variant of the
off-side rule
The off-side rule describes syntax of a computer programming language that defines the bounds of a code block via indentation.
The term was coined by Peter Landin, possibly as a pun on the offside law in association football.
An off-side ...
, in which indentation, rather than keywords or braces, is used to group blocks of code.
See also
*
Indent style
In computer programming, indentation style is a convention or style, governing the indentation of lines of source code. An indentation style generally specifies a consistent number of whitespace characters before each line of a block, so that ...
*
Obfuscated code
*
Curly-bracket programming language Many free-form languages are within this set.
References
Programming language classification
{{Prog-lang-stub