Programming Languages

Table of Contents

General Language Links

PL-Feature Grid (with relevance to evolvability)

Turing Machineλ-calcSKAPLStackBrain FuckASMELFCLispHaskellPythonJavacourgetteCA
direct addressingnonononoyesyesyesnonono
grammar
variable names
functions
alphabet size28finitefinitefinite
syntax complexity
variable length
side effectsyesnonoyesyesyesoptionalnoyesyesyes
literalsnononoyesyesnoyesyesyesyesyesyesyes

PL-Taxonomy

Languages

APL

I could see this being interesting when it comes out http://lathwellproductions.ca/wordpress/film-synopsis/

Alice

http://www.ps.uni-saarland.de/alice/

Another one of those crazy languages that seems to have support for every single programming paradigm and language feature imaginable. Notice it's ubiquity in the graph above.

bondi

Church

A probabilistic dialect of scheme with primitives tailored to the manipulation of probability distributions as first class objects http://projects.csail.mit.edu/church/wiki/Church

Clojure

http://clojure.org/ – Clojure on lambda-the-ultimatelisp advocacy

Clojure is a functional modern lisp (for motivation of lisps see Beating the Averages). It is designed from the ground up for concurrent programming, it is built upon a software transactional memory system STM (ABriefRetrospectiveOnTransactionalMemory), it runs on the java virtual machine making it very cross-platform and benefiting from the JVM optimization. Clojure compiles to java bytecodes, all clojure objects bottom out to java objects so it is possible to use all of the extensive java libraries naturally from within Clojure. Clojure is more "functional" than your standard lisp, enforcing immutability of most object to support concurrent programming, and supporting lazy evaluation and infinite lists like in Haskell.

Clojure videos

Clojure Reference

Clojure Examples

here's a really nice implementation of a 2d Cellular Automata with a little gui brians-functional-brain

One interesting tool implemented in clojure is Incanter (http://incanter.org/) which provides much of the same functionality of the R statistical language using standard java graphing libraries for all graphics generation, motivated by Back to the Future: Lisp as a Base for a Statistical Computing System by Ihaka and Lang (2008).

Clojure Topics

swarmiji is a framework that helps in writing distributed programs using the clojure programming language. We wrote it because our startup (Runa) needed computations to span not just clojure agents within single JVMs but across machines. This especially became the case as our load grew.

swarmiji uses the fantastic RabbitMQ as its central nervous system to communicate between service requesters and (possibly multiple) workers. It provides simple constructs to create these distributed services and makes it very easy to use them in your code. It has support for additional things like – automatic time-outs (if a worker fails), and a simple metrics collection system (to see how long services are taking, and where time is being spent). It also uses a very simple web-framework that allows clojure functions (that might use swarmiji) to be exposed as web-services.

Concatenative

Concatenative (or stack) languages – a whole new class of languages http://concatenative.org/wiki/, for two good examples see

Curry

Functional and Logic programming language, see http://www.curry-language.org/

Erlang

Built to be parallel, all computation takes place in "nodes" which can be transparently distributed across different processors, operating systems, and systems.

  • white_paper: provides a good introduction to the language
  • Reia: is a erlang scripting language

Haskell

Functional programming languages that seems to be more and more useful, the more we use it.

Java Script

Initially hacked together in 10 days, Java Script is now the most widely deployed and used programming language in the world. It's proponents say it can be used in a manner similar to scheme, and it does have continuations and first-class functions, however it is necessary to avoid the many bad parts of the language, for help in this area look at JavaScript-Good-Parts by Douglas Crockford, the king of good JS.

node.js server-side JS

http://nodeguide.com/

Posts about node.js

  • notes from building a simple web survey application
    Setup and instillation experiences/instructions
    • instillation of node.js, I found the stable version available on the download page to be preferable to the head of the git repository (ran into a small install bug with the git version)
    • there is a very nice (currently community standard) framework for web-development with node.js named express. Note, node.js provides an asynchronous web-server, and express builds a framework for building web applications on top of this server
    • it is best to install express with npm the node.js package manager, I found the node-and-npm-in-30-seconds.sh instructions from here to work well, although instead of installing in my home directory I sudo'd everything and installed system-wide. See here for more verbose instillation instructions
    • the express git repository has a fantastic examples directory of tiny example applications illustrating different concepts.

    the code for the survey application is up at github/eschulte/survey.js and the actual app is up at survey.adaptive.cs.unm.edu which probably won't resolve without an /etc/hosts hack because our DNS sucks.

    deploying

    • initially had problems getting all of the libraries installed on adaptive, people on irc recommended node bundle then adding
      require.paths.unshift('./node_modules')
      

      to the top of the app.js file. after doing this and copying the entire directory to /var/www/survey on adaptive everything worked fine

    • running node app.js starts up the node server listening at a port specified in the app.js file (in this case port 3693)
    • used the following apache config in /etc/apache2/sites-avalable/ to proxy survey.adaptive.cs.unm.edu to the node server listening on adaptive.cs.unm.edu:3693
      <VirtualHost *:80>
        ServerName survey.adaptive.cs.unm.edu
        ServerAdmin eschulte@cs.unm.edu
      
        ProxyPass / http://adaptive.cs.unm.edu:3693/
      </VirtualHost>
      

Lisp – Common Lisp

Implementations

  • ABCL armed bear common lisp
    runs on the Java Virtual Machine
  • Clozure
    Supposed to have good concurrency support and a clean FFI implementation, trying this one out first.
    Wikihttp://trac.clozure.com/ccl/wiki
    init~/.ccl-init.lisp

Useful Tools and online Resources

Matlab

did you know the inventor of Matlab, Cleve Moler, was the Chair of our CS dept ?

Oz

Oz seems crazy, it incorporates basically every major programming paradigm, with special support for concurrency

  • http://www.mozart-oz.org/
  • http://www.mozart-oz.org/documentation/tutorial/index.html – "This tutorial introduces the Oz programming language and the Mozart programming system. Oz is a multi-paradigm language that is designed for advanced, concurrent, networked, soft real-time, and reactive applications. Oz provides the salient features of object-oriented programming including state, abstract data types, objects, classes, and inheritance. It provides the salient features of functional programming including compositional syntax, first-class procedures/functions, and lexical scoping. It provides the salient features of logic programming and constraint programming including logic variables, constraints, disjunction constructs, and programmable search mechanisms. It allows users to dynamically create any number of sequential threads. The threads are dataflow threads in the sense that a thread executing an operation will suspend until all operands needed have a well-defined value."

Pregel

An interesting graph vertex distributed programming language, used at google large-scale-graph-computing-at-google

Python

Qi

Qi is no longer supported in favor of its successor shen.

Written in Common Lisp, Qi is an attempt to bring lisp into the future, it looks/acts very similar to Haskell. It allows both regular lisp S-expressions (for meta-programability) and M-expression (the syntactic mess common in other programming languages).

Ruby

Shen

See http://www.shenlanguage.org/.

Shen is a modern functional language implemented overtop of a minimal set of lambda-calculus functions called k-λ. Thanks to this minimal core Shen is easy to port to new platforms and scheduled to be implemented on top of Common Lisp, Scheme, Javascript, the LLVM compiler and Python.