History of programming languages
--------------------------------

So many languages:

  * list of 2500 past and present (http://people.ku.edu/~nkinners/LangList/Extras/langlist.htm).

  * Rosetta stones:

       * Very short (http://www.lurklurk.org/rosetta.html);

       * Extensive (http://rosettacode.org/wiki/Main_Page);

  * History From Fortran to the present day (http://www.levenez.com/lang/lang_a4.pdf).

  * See also Appendix A, Scott

Why so many?

Which language is best?

(From LtU Classic Archives (http://lambda-the-ultimate.org/classic/message4521.html))

Does the controversial Sapir-Whorf Hypothesis or theory of "linguistic relativity" that has been proposed for human languages hold for programming languages and the programmers who use them?

"Linguistic relativity" is the...

     ``proposal that the particular language one speaks influences the way one thinks about reality"... According to the theory, "people who speak different languages perceive and think about the world quite differently"...

     "The Sapir-Whorf Hypothesis is the most famous. Benjamin Whorf's hypothesis had two interpretations, the first is called determinism ["people's thoughts are determined by the categories made available by their language"], and the second is labeled relativism ["differences among languages cause differences in the thought of their speakers"..... "

Do the language features of the programming languages a programmer uses as a computer science student determine the ideas that a programmer is able to use and understand as a professional programmer?

Kenneth E. Iverson, the originator of the APL programming language, believed that the Sapir-Whorf hypothesis applied to computer languages (without actually mentioning the hypothesis by name). His Turing award lecture (http://elliscave.com/APL_J/tool.pdf), "Notation as a tool of thought", was devoted to this theme, arguing that more powerful notations aided thinking about computer algorithms. The essays of Paul Graham (http://www.paulgraham.com/avg.html) explore similar themes, such as a conceptual hierarchy of computer languages, with more expressive and succinct languages at the top.

I used to believe in Sapir-Whorf and wrote a lot about domain-specific programming languages (http://www.paulgraham.com/avg.html) where the language was tuned to the idioms of the local experts. Years later, I have yet to see the evidence that it is indeed a productive approach (indeed, other factors may be far more important (http://menzies.us/index.php?news=7070)). For example, if we ask the question "which language is fastest to run or easiest to use?", we get contradictory answers. It turns out that "fastest" and "easiest" are almost mutually exclusive (faster languages are longer to write and vice versa):

(Data from benchmarks at the Great Language Shootout (http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=sbcl&lang2=python3)).

Note the trade-off between lines of code of the function and its runtime: halving the lines of code (from two KB to one) can increase the runtimes by an order of magnitude, or more.

Perhaps we should not ask what language is best. In terms of earning a pay cheque, a more important question is "what language will someone else pay me to use?".

Depending on how you ask this question, you get different answers. The TIOBE web site (http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html) has has its own magic indexes for comparing languages.

(The May'04 Java dip is due to a Google purge of suspect sites from its web indexes. In response, TIOBE added other search engines to its sampling.)

Note that:

  * No language is in the majority

  * The "best" language (JAVA) only scores under 25% on their scale;

  * While the trend is not clear, one reading on the above plot is that the dominant three languages (JAVA, C++, C) are losing their dominance.

The method used to generate the above ratings have been seriously questioned (http://blog.timbunce.org/2008/04/12/tiobe-or-not-tiobe-lies-damned-lies-and-statistics/). We need not explore those issues here except to say that comparatively assessing different languages is a very difficult (?impossible).

Anyway, one thing is clear: on the balance of probabilities, you will not be spending your professional life working on one language. Rather, you will be using any number of languages during your career. For example, here's a recent chat I had with someone working in a Silicon Valley start-up:

     Today was spent refactoring some RUBY to provide a simple interface... was doing this yesterday too... luckily I was rescued by a PROLOG problem which came up... then back to RUBY and finally diverted by a problem which superfisherly (sic) looks like a PROLOG problem but is actually a C crap problem

This is why this subject is important. Here, we try to teach general principles that apply to multiply languages. Hopefully this means that, in the future, you will be able to learn new languages, as required.

Brief survey of programming paradigms
-------------------------------------

Imperative:

  * Central features are variables, assignment statements, and iteration.

  * Include scripting/visual languages.

  * Examples: C, Java, Perl, JavaScript, Visual BASIC .NET, C++

  * Includes object-oriented languages:

       * uses "objects" and their interactions to design applications and computer programs.

       * Programming techniques may include features such as encapsulation, modularity, polymorphism, and inheritance.

       * Examples: RUBY, C++.

Functional programming:

  * a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data.

  * It emphasizes the application of functions, in contrast with the imperative programming style which emphasizes changes in state.

  * Examples: Scheme, Ocaml, Haskell, LISP(ish).

Logic programming:

  * Purely declarative representation language, and a theorem-prover or model-generator is used as the problem-solver.

  * The problem-solving task is split between the programmer, who is responsible only for ensuring the truth of programs expressed in logical form, and the theorem-prover or model-generator, which is responsible for solving problems efficiently.

  * Examples: PROLOG

The projects of this subject are divided up into the above paradigms.