Notes on programming languages

Below we consider a selection of programming languages which we consider important for their educational or practical value, or historical impact. This is a work in progress.

Fortran

Introduced in , Fortran (for ‘formula translation’), besides remaining an important language for scientific computing to this day, introduced or codified a number of conventions for writing arithmetic expressions still commonplace among contemporary programming languages; such as the use of * (one of arguably rather limited set of non-alphanumeric commonly available in character sets back in the day) to denote multiplication (and, to a lesser extent, ** for exponentiation), = to denote assignment, and E (in ) to denote decimal exponent.

Example code
A = SQTF (1.7E3 + 8 ** 2)
Result
Variable A set to value 42 (floating point.)

Tcl

Complex software requires similarly complex means of control. Tcl (for ‘tool control language’; introduced in ) was originally envisioned as a common programming language suitable for embedding into various complex programs; back when such programs tended to rely on their own, often ad-hoc, languages for the purpose.

Tcl has very simple syntax, with that of code partially shared with that of data, although not to the degree it’s the case for Lisp-family languages. The language effectively allows for new ‘syntactic’ constructs to be added by the user, also similar in idea (though not in implementation) to Lisp-like languages.

A particular feature of the language is its adherence to the everything is a string (or EiaS) principle. Every value in the language is indistinguishable from a string, although built-in operations often use internal representations (stored alongside strings proper) of such objects as numbers and lists for better efficiency.

Due to its simplicity, we deem Tcl to be particularly suited as one of the first languages for a novice programmer to study systematically (perhaps alongside less systematic study of JavaScript and POSIX shell, for their more immediate practical benefits); as well as for writing auditable code.

Example code
lassign { 1 "2 3" z } x y
Result
Variable x set to value 1, and variable y set to value 2 3. (The third and final value, z, of the given list is not used.)

POSIX shell

A descendant of the original Bourne sh interpreter (introduced in ) specified as part of the POSIX standard (first edition: , latest: .)

The language is string-centric and relies on various substitutions. More importantly, the language allows for simple programs that process standard input and produce results on standard output (also known as filters) to be combined into pipelines to achieve desired function.

Example code
printf %s\\n $((1 + (-1 + $(date +%s --date=2013-09-27) + $(date +%s --date=1997-06-09)) / 86400))
Result
The number of days (25996) between and is printed to standard output.

Prolog

The creation of Prolog (for programmation en logique; c. ) was prompted by the observation that Horn clauses posess the same power to express arbitrary computation as a universal Turing machine.

Example database
factorial(0, 1).
factorial(A, B) :-
    A > 0, succ(A1, A),
    factorial(A1, B1),
    B is A * B1.
Example query
factorial(11, X).
Result
X = 39916800.