Programming Languages

Alan Perlis once said: "A language that doesn't affect the way you think about programming, is not worth knowing".

Here are some opinions and facts about a selection of programming languages by Dr Mark Utting (a lecturer in the Department of Computer Science at The University of Waikato).

Topics within this page
Object-Oriented Languages Functional Languages
Logic Programming Languages Transformation Languages (QVT etc.)
Text Formatting/Typesetting Languages (TeX) Language Design Issues/Mistakes

The TIOBE index is one way of measuring the popularity of programming languages over time. The Open Directory Project has lots of programming language information.

For examples of programming in 200+ different languages, check out the 99 Bottles of Beer page. The Dylan version is nice, but make sure you check out all the C++ versions too! The template version is amazing!

The BenchMarks Game website compares the speed, and also speed versus conciseness of hundreds of programming languages, using a small suite of benchmark programs. Typically, C is the fastest (but is low-level and more verbose), while languages like JavaScript, Ruby, Perl and Python are more concise.

Another useful overview of programming and web languages is IT Hare's Beginner's guide to Programming Languages, which gives a bit of history and overview of the dozen most common imperative programming languages that are widely used.

Object-Oriented Languages

Let us start with some lesser-known, but more novel, object-oriented languages (OOLs), then work down to the well-known mainstream ones.

One of my favourite object-oriented languages at the moment is Julia: a high-level, high-performance dynamic programming language for technical computing, with familiar syntax. It is a multiple-dispatch language, which is quite similar to the theoretical language that I developed in my PhD thesis for proving the correctness of object-oriented programs.

An older but equally nice language is Dylan. Like Julia and Cecil, Dylan is a safe, dynamic, pure object-oriented language that supports multiple dispatch, modules, first-class functions etc. Dylan was originally designed by Andrew Shalit and others at Apple, then a commercial implementation for Windows 95/NT platforms was developed by Harlequin Ltd. (later Functional Objects Inc.), which later became the basis for OpenDylan. Free versions of Dylan for various UNIX machines are available from the GywdionDylan group. Other useful Dylan sites include:

Python is another favourite of mine. Interpreted and dynamically typed, it is ideal for knocking up quick prototypes, but it has a nice module system, lots of handy libraries, and is almost purely object-oriented.

Apart from Simula-67, Smalltalk started the OO craze. Squeak is an open source Smalltalk that has become very popular.

Some other clean OOLs are:

The most widely-used object-oriented programming languages today are all based on the C programming language (which is still the most widely used programming language): Objective-C and C+++ add objects or classes to C while trying to retain full compatibility with C, while C# and Java are loosely based on C but take a more pure object-oriented approach to try and raise the programming level to be a bit higher (they add garbage collection, remove some of the error-prone aspects of C such as pointer arithmetic, and include safety features such as checking array bounds).

Objective-C is widely used for programming iPhone apps, but in 2015 Apple proposed a new language, Swift, for app development.

C++ is one of the most widely used object-oriented languages. Some starting points for learning about C++ are:

Java was designed to be safer and cleaner than C++ (see the original Java white paper). Two attractive aspects of Java are that it is (mostly!) a safe language (all errors are caught by the compiler or bytecode checker or cause runtime exceptions), and that Java programs are portable across different machines without recompiling (including its wide range of standard libraries).

Here are several interesting extensions/variants of Java:

Objects have also been added to the Ada programming language. In fact, Ada was actually the first ISO standardized OO language (Ada95)! Ada 2005 and Ada 2012 have added even more support for object-orientation and design-by-contract features.

Finally, CLU is an old but influential language that introduced important ideas such as Iterators for iterating through collection objects, multiple return values, and a carefully-designed theory of object invariants, pre/post conditions etc.

Functional Programming Languages

(Pure) Functional Programming Languages are declarative programming languages where computation is done by evaluating expressions, rather than by assignment statements that update variables.

Haskell is the most popular functional programming language and is the one that I've used a lot (for example, my Z animator, Jaza). It is an elegant lazy high-level language, with fast compiled implementations plus a interpreter (HUGS) that is good for development. It also comes with a large collection of amazing libraries for writing parsers, pretty-printers, MIDI composition programmes (Haskore) etc., plus the ability to interface to arbitrary C procedures in a functionally clean way.

One of the advantages of Haskell is that expert programmers can extend the language by defining their own operators and 'monads', to get a very concise application-specific language. The disadvantage of this power is that if you overuse it, it becomes difficult for other people to read your programs!

Other popular functional programming languages include the eager (non-lazy) ML family of languages, such as Standard ML and Objective CAML. F# (from Microsoft), Scala and Julia (see above) are some other languages that emphasize functional programming, but also support imperative and object-oriented programming.

Logic Programming Languages

Logic programming is about writing programs as a set of logical rules, rather than as a sequence of instructions for the computer to execute. The ALP (Association of Logic Programming) has a newsletter, journals and conferences about logic programming.

Prolog is the most commonly known logic programming language, albeit impure. There are lots of Prolog implementations available, including some open source ones. Roman Bartak's Interactive Prolog Guide includes FAQs, program samples, implementations, and references.

Qu-Prolog is Prolog customised for formal methods (it handles quantifiers, object-variables and substitutions as primitives).

Mercury is an elegant, pure, logic programming language from Melbourne University. The fastest logic programming language around...

I was part of the Starlog/JStar research group (1996-2012), which designed and implemented a novel pure logic-programming language that is especially suited to reactive and real-time programming. We implemented a version of Starlog for controlling Lego Robots, and several implementations of JStar (a derivative of Starlog, with more Java-like syntax) for parallel programming of data-intensive applications.

Curry is an extension of Haskell that adds logic-programming features like logical variables, constraint solving and concurrent and distributed programming.

Here are some useful online sites for constraint logic programming, which is a powerful technique for solving constraint satisfaction problems (see the bottom of that page for some Prolog implementations that include support for constraint logic programming):

Transformation Languages

Some languages for transforming models and programs:

Text Formatting Languages

LaTeX is the defacto text formatting system for academic papers containing mathematics. See also the Comprehensive TeX Archive Network (CTAN). The University of Cambridge LaTeX page is also a good introduction to tools and packages for LaTeX.

Language Design Issues and Mistakes

Here are a few interesting papers about language design:
Last modified: Sat Oct 10 12:36:28 AEST 2015