For those who think the world begins and end with C++, or with Java, here is a very incomplete list of programming languages: just the ones I've heard of, or been told about (not including assembly languages, or special purpose 'little languages' like yacc or nroff).
-- Alan J. Perlis. Epigrams onProgramming.
SIGPLAN Notices 17 (9):7-13, September 1982
Ada the language was commissioned by the US Department of Defense in the 1980s as the language to be used for all its software. Descended from Pascal, with support for structuring via the package.
-- unknown
-- an Ada code fragment package Stack is procedure Pop return INTEGER; procedure Push(x:INTEGER); procedure IsEmpty return BOOLEAN; end Stack;
-- C. A. R. Hoare, "The Emperor's Old Clothes", CACM24(2), 1981
Algol-60. Algol-68W. Algol-68. A family of procedural languages.
-- C. A. R. Hoare, "Hints on Programming Language Design", 1974
--
C. A. R. Hoare, "The Emperor's Old Clothes", CACM 24 (2), 1981
(on the design of ALGOL 68 v. Ada)
Designer: Ken Iverson, in the late 1950s/early 1960s.
-- Stan Kelly-Bootle, The Devil's DP Dictionary, 1981
Famous for its enormous character set, and for being able to write whole accounting packages or air traffic control systems with a few incomprehensible key strokes.
-- David Given
Michael Gertelman has coded Conway's Game of Life in one line of APL:
Dyalog has done even better (the web page includes a link to a YouTube video explaining how it works):
-- Edsger W. Dijkstra, How do we tell truths that might hurt? EWD498, 1975
An interpreted language with pattern matching, associative arrays, no declarations, implicit type casting, and C-like syntax. Wonderful for quickly hacking small special-purpose Unix filters; a nightmare when grown into large programs
# an awk code fragment BEGIN { FS = "\t" } { total[$4] += $3 } END { for (name in total) print name, total[name] }
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.-- Charles Babbage, 1792-1871
An interpreted procedural language, originally invented in the 1960s for teaching, which has spread out of control.
-- Edsger W. Dijkstra, How do we tell truths that might hurt? EWD498, 1975
80 INPUT N%
90 IF (N% > M%) THEN 80
100 FOR I% + 1 TO N%
110 X(I%) = RND
120 NEXT I%
130 GOSUB 6000
-- unknown
[that is, great for simple addition, a nightmare for more
sophisticated long division]
BBC BASIC -- designed for Acorn's BBC micro -- added control structures and procedures, and is a greatly improved language, but is still suitable only for small programs.
Designer: Martin Richards.
// a BCPL code fragment LET SWAP(X,Y) BE $( LET TEMP = !X !X := !Y !Y := TEMP $)
Designer: Dennis Ritchie, Bell Labs in the early 1970s. A procedural language originally designed as a system programming language for the PDP, now out of control.
Variants: K&R C (Kernighan and Richie C). Ansi-C.
-- Robert Firth
/* swap tabs for spaces */ for( i=0; (c=getchar())!=EOF && c != '\n'; i++ ) s[i] = c!='\t' ? c : ' ';
The above is everyday C code. (And some people who quite happily write this sort of stuff all day complain that Z is difficult "because of all those strange symbols"!) Obfuscated C , on the other hand, looks more like:
/* * HELLO WORLD * by Jack Applin and Robert Heckendorn, 1985 */ main(v,c)char**c;{for(v[c++]="Hello, world!\n)"; (!!c)[*c]&&(v--||--c&&execlp(*c,*c,c[!!c]+!!c,!c)); **c=!c)write(!!*c,*c,!!**c);}Eric Raymond, ed. The New Hacker's Dictionary
-- Erwin Dieterich
Designer: Bjarne Stroustrup. C with object oriented extensions; even more out of control than C
-- Gavin Russell Baker
// a C++ code fragment void f() { olist ll; name nn; ll.insert(&nn); name* pn = (name*)ll.get(); }
-- Steve Haflich, comp.lang.lisp, December 1994
-- Robert Firth (firth @ sei.cmu.edu) 94/03/18
as quoted by Dirk Craeynest at
http://www.cs.kuleuven.ac.be/~dirk/quotes.html
-- Alan Kay
The Computer Revolution hasn't happend yet : Keynote, OOPSLA, 1997
-- Steve Taylor, 1998
(where CCITT = Comité Consultatif International Télégraphique et Téléphonique)
A lazy, purely functional language, with "almost-as-good-as-C" efficiency.
/* sieve of Eratosthenes */ primes :: [Int] primes = sieve [2..] sieve :: [Int] -> [Int] sieve [prime:rest] = [prime: sieve [i \\ i <- rest | i mod prime <> 0]]
A modular procedural language, with a rich set of types and particular support for user-defined abstract data types, called clusters.
Designer: Grace Murray Hopper. A verbose procedural language designed for business applications.
-- C. A. R. Hoare, "Hints on Programming Language Design", 1974
There is an amazing amount of COBOL "legacy code" or "dusty decks", which made COBOL programmers sought-after and rich tackling the Year 2000 problem.
-- Edsger W. Dijkstra, How do we tell truths that might hurt? EWD498, 1975
Developers: Benedict Løfstedt and Børge R. Christensen, in 1973. An introductory programming language, used for teaching.
FOR r#:=1 TO rows#-1 DO PRINT AT y#+r#,x#: CHR$(179), PRINT CHR$(179) ENDFOR-- program fragment taken from a COMAL supplier site
A descendant of Simple, used for the Limits to Growth models.
Designer: Bertrand Meyer. An elegant object oriented language, designed to support reuse, and including support for logical assertions.
-- an Eiffel code fragment putIth(v: like first; i:INTEGER) is require
indexLargeEnough: i >= 1; indexSmallEnough: i <= count; deferred
ensure not empty end
Originally designed to control scientific instruments, in particular, telescopes.
-- Mark Atwood, rec.arts.sf.written, Jan 2002
\ a Forth code fragment : CASE: CREATE SMUDGE ] DOES> SWAP 2* + @ EXECUTE ;
If a variable is not declared, it is implicitly given a type based on its first letter ( I to N being integers, the rest floats), which led to the famous story of losing a spacecraft.
-- Sun FORTRAN Reference Manual
C a FORTRAN IV code fragment DO 70 I = 1,3 N = KEY(1,I) DO 50 J = 1,N IF (KARD(J) .NE. KEY(J+1,I)) GOTO 70 50 CONTINUE GOTO 200 70 CONTINUE 200 END
-- FORTRAN manual for Xerox computers
[Some net-copies of this quote have the last digit as a
7. But pi=3.14159 26535 89793 23846 ... Is it a transcription
error, or an error in the original manual? Is the whole
quotation just a UL, or is it real?]
Variants: Fortran-II. Fortran-IV, roughly equal to Fortran-66. Fortran-77. Fortran-90 (previously Fortran-8X). Watfor = Waterloo Fortran. Ratfor = Rational Fortran (a preprocessor to add control structures to Fortran-66)
Designer: Ian Page. A language hiding an occam-like semantics underneath a C-like syntax, designed for compiling down to hardware, especially FPGAs.
/* an occam code fragment */ prialt { case louder ? any : volume = volume + 1 ; break ; case softer ? any : volume = volume - 1 ; break ; } amplifier ! volume ;
A functional language.
Designers: Ralph Griswold, Dave Hanson, Tim Korb. A string processing language, a descendent of Snobol, with structuring.
# an Icon code fragment while line := read() do if line := line[upto(wchar,line):0] then return line[1:many(wchar,line)]
Developers: James Gosling, Sun Microsystems, 1990's
Syntax like C++ "with all the nasty bits taken out". Compiles down to bytecode for a virtual machine, greatly increasing portability (if not performance).
/* Hello, World in Java */ public class Example { public static void main(String[] args) { System.out.println("Hello, World!"); } }
Developer: Brendan Eich, Netscape, 1990's.
A dynamic language mostly used in web browsers.
/* Hello, World in JavaScript */ console.log("Hello, World!");
(or... Lots of Irritating Superfluous Parentheses)
Designer: John McCarthy, MIT, late 1950s. A functional language, used mainly for AI applications.
-- Alan J. Perlis. Epigrams on Programming.
SIGPLAN Notices 17 (9):7-13, September 1982
;;; a Lisp code fragment (DEFUN MEMBER (ITEM S) (COND ((NULL S) NIL) ((EQUAL ITEM (CAR S)) S) (T (MEMBER ITEM (CDR S)))))
-- Mark Atwood, rec.arts.sf.written, Jan 2002
Variants include: Scheme
Designer: Seymour Papert. Turtle graphics
; draw a square in Logo TO SQUARE REPEAT 4 FORWARD 100 RIGHT 90
Designers: Ed Ashcroft and Bill Wadge, 1974. Lucid programs are intrinsically parallel and provable.
A matrix-based language that lets you write maths how it wants to be written, with hardly a loop in sight.
Example: take a 2D matrix M, perform a singular value decomposition, normalise the resulting vector of singular values si to treat them as a vector of probabilities pi, and calculate the Shannon entropy H:
% a Matlab code fragment S = svd(M); P = S/sum(S); H = - dot(P,log2(P));
A functional language.
A functional language with modules, developed at the University of Edinburgh.
(* an ML code fragment *) fun reverse ([], ys) = ys | reverse (x::xs, ys) = reverse(xs, x::ys);
Designer: Niklaus Wirth. A descendent of Pascal that added modules for large-scale structuring.
Variants: Modula, Modula-2, Modula-3.
(* a Modula code fragment *) DEFINITION MODULE InOut; EXPORT QUALIFIED EOL, Done, termCH; CONST EOL = 36C; VAR Done: BOOLEAN; termCH: CHAR; PROCEDURE OpenInput(defext: ARRAY OF CHAR); PROCEDURE OpenOutput(defext: ARRAY OF CHAR); END InOut.
Designers: Niklaus Wirth and Jurg Gutknecht. An object oriented language descended from Pascal and Modula-2
(* an Oberon code fragment *) DEFINITION Texts; IMPORT Display, Files, Fonts; CONST replace = 0; insert = 1; delete = 2; TYPE Buffer = POINTER TO BufDesc; BufDesc = RECORD len: LONGINT END; PROCEDURE Append(T:Text; B:Buffer); END Texts.
Designer: Brad Cox. A hybrid object oriented language containing all of C and some Smalltalk-like method syntax.
// an Objective-C code fragment float total = emptyWeight; int i, n = [self size]; for (i=0; i<n; i++) { id member = [self at:i]; total = total+[member weight]; } return total;
A parallel programming language, based on Hoare's formal language CSP (Communicating Sequential Processes), supported by the inmos Transputer.
-- an occam code fragment SEQ ALT louder ? any volume := volume + 1 softer ? any volume := volume - 1 amplifier ! volume
A rule based AI programming language
Designer: Niklaus Wirth in the late 1970s. A descendent of Algol, originally invented for teaching, which has spread out of control. (Uses semicolons to separate statements, rather than to terminate them, a cause of much grief.)
{* a Pascal code fragment *} while not eof(fn) do begin read(fn,next); sum := sum + next; end
(or... " Pathologically Eclectic Rubbish Lister", sometimes known as "the Swiss-Army chainsaw")
-- unknown
Designer: Larry Wall. A descendent of awk, and lots of other things.
-- Keith Bostic
# a Perl code fragment while ( <> ) { next unless s/^(.*?):\s*//; $HoL{$1} = [ split ]; }
-- unknown
-- anon
Criticised for being large and complex.
/* a PL/I code fragment */ ON CONDSIGNAL (NEW) BEGIN LINECOUNT = 1; PAGECOUNT = PAGECOUNT + 1; WRITE FILE(REPORT) FROM (HEADLINE); END;
-- Edsger W. Dijkstra, How do we tell truths that might hurt? EWD498, 1975
An AI programming language, originally developed at the University of Edinburgh, then the University of Sussex
-- a Pop-11 code fragment define doubleList(lst); vars temp; [] -> temp; until lst = [] do temp <> [^(hd(lst)*2)] -> temp; tl(lst) -> lst enduntil; temp enddefine;
Designed by Adobe. A stack-based procedural language, designed for driving laser printers and graphics.
% a PostScript code fragment currentpoint 4 2 roll exch 4 -1 roll exch sub 3 1 roll sub exch atan rotate dup scale -1 2 rlineto 7 -2 rlineto -7-2 rlineto closepath fill
A logic language, used mainly for AI applications.
% a Prolog code fragment descendant(X,Y) :- offspring(X,Y). descendant(X,Y) :- offspring(X,Z), descendant(Z,Y).
Developer: Guido van Rossum, 1990's
A general-purpose scripting language with libraries for almost everything.
-- unknown
# list of x's where x^3-x is not divisible by 3 [ x for x in range(-4,10) if (x * x * x - x)%3 != 0 ]
Developer: Yukihiro "Matz" Matsumoto, 1990's
A general-purpose reflective language.
--
Kent Beck
Rick DeNatale --
Old Smalltalkers perceptions of Ruby
# sum an array myarray = [ 1, 2, 4, 8, 17, 3 ] tot = 0 myarray.each { |i| tot += i } print "total is #{tot}\n"
Designers: Ole-Johan Dahl, Bjorn Myhrhaug, Kristen Nygaard. The first object oriented language, an extension of Algol 60.
comment a Simula-67 code fragment ; CLASS MEMBER; BEGIN REF(MEMBER)NEXT; PROCEDURE PUSHDOWN(L);REF(CHAIN)L; IF L=/=NONE THEN BEGIN NEXT:-L.FIRST; L.FIRST:-THIS MEMBER; END***PUSHDOWN***; END***MEMBER***
Designed by Xerox-Parc. A pure object oriented, untyped language.
"a Smalltalk code fragment" ^(self includes: aSymbol) ifTrue: [self controlKeys at: aSymbol] ifFalse: [aBlock value]
A string processing language, much used in the Humanities for textual analyses.
* a Snobol code fragment MORE LINE = INPUT :F(END) LINE PAT :F(MORE) OUTPUT = LINE :(MORE) END
Donald Knuth's macro-based text formatting language, started in the late 1970s. Included here because of its incredible complexity, and because someone has written Towers of Hanoi, and 8-queens, in it (presumably just because they could).
% a TeX code fragment \def\listoftables{\section*{List of Tables\@markboth {LIST OF TABLES}{LIST OF TABLES}}\@starttoc{lot}}
Variants: LaTeX, AMS TeX
Turing (and OOT) is a general purpose programming language designed specifically for teaching the concepts of computer science.
% Roll a die until you get 6 var die : int loop rand int (die, 1, 6) exit when die = 6 put "This roll is ", die end loop put "Stopping with roll of 6"