Phil Trelford's Array
POKE 36879, 255

Unboxing FP

October 7, 2014 23:39 by phil

How hard is it to get started in functional programming?

Let’s have a look at how quickly you can get started on a selection of simple expression-oriented programming languages.

Today let’s try Clojure, Elm, F#, Haskell and OCaml.

Online REPL

No install required just point your browser at a URL and you’re off:

Language Online REPL


Each language has an easy to use online REPL with simple lessons to get you through the basics. Elm’s online offering lets you edit multi-line programs, as does Try F#, which also includes intellisense in the online editor.

Development environment

Now you’ve covered the basics you probably want to install a lightweight development environment and start building larger programs:


I found LightTable very quick to install and setup. The editor comes with psychedelic colours to help you track opening and closing parenthesis:

FizzBuzz Clojure

I’ve been using Stuart Holloway’s Programming Clojure book as a guide.


Elm has a very usable online editor, a simple installable REPL, and a wonderful playground feature with Elm Reactor:


If you’re on Windows and have Visual Studio installed then you’ve already got F#. From the file menu click New and select a new F# project or script file.

No Visual Studio, no problem, for Windows the Tsunami IDE is a fast 25MB download, which gives you the latest compiler and an editor with intellisense:

Tsunami IDE

On Mac I’d recommend Xamarin Studio and for Linux MonoDevelop or Emacs.

Functional Programming using F# and Dave Fancher’s recent Book of F# are both great introductory texts.


The Haskell platform gives you a compiler and REPL from a simple 100MB install. A combination of a text editor along with the REPL gets you going in no time:

Haskell FizzBuzz

As a guide I’ve been using the Real World Haskell book. Learn you an Erlang some Haskell for great good! looks like a fun read too.


Like Haskell, OCaml is bundled in a simple installer and includes the compiler and REPL. Choose your own editor and use the REPL to explore your programs.

I recently picked up OCaml from the Very Beginning and More OCaml, which are both nice concise introductions.

OCaml From The Very BeginningMore OCaml


Using an online REPL you can get started with any of these languages in seconds, and there are plenty of lightweight install options too. Combine that with a good selection of learning resources from books to online courses, and we can conclude that nowadays it’s really not that hard to get started with FP.

Categories: Clojure | Elm | F# | Haskell | OCaml
Actions: E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

Try 10 Programming Languages in 10 minutes

August 31, 2013 10:47 by phil

There are a lot of interesting programming languages out there, but downloading and setting up the environment can be very time consuming when you just want to try one out. The good news is that you can try out many languages in your browser straight away, often with tutorials which guide you through the basics.

Following the pattern of 7 languages in 7 weeks book, here’s a somewhat abridged version.

Dynamic Languages

Fed up of long compile times, want a lightweight environment for scripting? Dynamic languages could be your new friend.

Try Lua

Lua is a lightweight dynamic language with excellent coroutine support and a simple C API making it hugely popular in video gaming for scripting. Have fun with game engines like LÖVE and Marmalade Quick.

Try Clojure

Clojure is the brainchild of the hugely charismatic speaker Rich Hickey, it is a descendant of one of the earliest programming languages LISP. There’s a really rich community around Clojure, one of my favourite projects is Sam Aaron’s Overtone live coding audio environment.

Try R (quick registration required)

R is a free environment for statistical computing and graphics, with a huge range of user-submitted packages. Ever wondered how to draw an egg?

Functional Languages

Aspects of functional programming have permeated most mainstream languages from C++ to VB. However to really appreciate the expressiveness of the functional approach a functional-first language is required.

Try Erlang

Erlang is a really interesting language for building fault tolerant concurrent systems. It also has great pattern matching capabilities. It has many industrial applications and tools including the RabbitMQ messaging system and the distribute database Riak.

Try Haskell

Haskell is heavily based on the Miranda programming language which was taught in British universities in the 80s and 90s. Haskell added Monads and Type Classes, and is still taught in a few universities, it is also still quite popular in academic research.

Try OCaml

OCaml like Miranda is based on the ML programming language adding object-oriented constructs. F# is based on OCaml, there is even a compatibility mode. OCaml still has industrial application, for example at Jane Street Capital and XenSource.

Web Languages

There’s a plethora of languages that compile to JavaScript languages out there. Also worth a look are the new features in JavaScript itself, see Brendan Eich’s talk at Strangeloop last year on the The State of JavaScript. Here’s 3 *Script languages I find particularly interesting:


LiveScript is an indirect descendant of CoffeeScript with features to assist functional programming like pattern matching and function composition. Check out 10 LiveScript one liners to impress your friends.

Try Elm

Elm is a functional reactive language for creating highly interactive programs, including games. Reactive programming is an interesting direction and I think languages designed specifically for this are worth investigating.


Unfortunately there’s currently no online editor for this one, but there is a command line REPL. PogoScript is DSL friendly allowing white space in function names.

Esoteric Languages

Esoteric languages tend to be write-only, a bit like Perl but just for fun.

Try Brainfuck

Brainfuck is the Rubik’s cube of programming languages. I built the site last year with the interpreter written in plain old JavaScript, check out the fib sample.

Browser IDEs

With so many programming language experimentation environments available online, the next logical step is to host the IDE there. Imagine not having to wait 4 hours for Visual Studio to install.

Cloud 9 is an online environment for creating Node.js apps, pulling together sets of relevant packages. Tools like Sploder let you build games online.

The Try F# site offers arguably the most extensive online learning features of any language. Cloud Tsunami IDE also offers a rich online development experience for F#. In the near future CloudSharper will offer an online IDE experience for developing web applications with F# using WebSharper,

Scaling up

Once you’ve completed some basic tasks in a new language you’ll want to move on to slightly larger tasks. I like to use exercises from the coding Kata Catalogue like FizzBuzz, the Game of Life and Minesweeper.

Some people enjoy going through the Project Euler problems, others have their own hello world applications. For Martin Trojer it’s a Scheme interpreter and Luke Hoban often writes a Ray Tracer.

I’d also recommend joining a local meetup group. The London Scala meetup have a coding dojo every month and the F#unctional Londoners meetup have hands on session in the middle the month, the next one is on Machine Learning.

Programming language books that include questions at the end of sections are a good way to practice what you’ve learned but are few and far between. The recent Functional Programming with F# book is an excellent example of what can be done with questions at the end of each chapter.

While the basics of a language can be picked up in a few hours, expect it to take a few weeks before you’re productive and at least a few months before you start to gain mastery.

Want to write your own language? Pete Sestoft’s Programming Language Concepts book offers a good introduction to the subject.

Categories: F# | Lua | JavaScript | Clojure | Erlang | Haskell | Scala
Actions: E-mail | Permalink | Comments (3) | Comment RSSRSS comment feed

Developer Conferences

August 4, 2013 11:08 by phil

Developer conferences are a great way to learn about new and existing technologies. Almost as important are the conversations in the corridors between talks and bars after to find out what your peers from other companies are up to. Without them your company may run the risk of becoming like a small island cut off from the mainland, perpetuating a monoculture.


But there are a bewildering array of conferences to choose from, and for most of us only a limited time and budget to work with. Here’s a few tips.


The most common format is a few days of talks, usually spread across a number of themed tracks with each talk lasting somewhere between half an hour and an hour.

I try to get to a handful of conferences a year, which is in part made possible by speaking at some of the them. If you’re speaking typically the entrance fee is waived and if the conference is remote then often the organizer will contribute towards your travel and accommodation. Don’t expect too much though, unless you’re giving a keynote you shouldn’t expect to get paid, so for the most part speakers are giving their time freely.

A talk lets the speaker really emphasise what they think is important when introducing a subject, something that is much harder to portray in an article. I recommend choosing a few talks out of your normal area/comfort zone, often you’ll learn something new and interesting and sometimes even applicable. Don’t expect to become an expert after listening to a one hour talk, at best you might get two or three key concepts which you can build on in your own time.


Many of the large conferences tag half day training sessions at the start of the conferences. This can be a good way to deep dive in to a particular topic and get some hands on experience with the help and support of an expert. Some conferences specialize in this kind of training like Skills Matter’s Progressive .Net Tutorials and Progressive F# Tutorials which are comprised almost entirely of half day hands on sessions.


One or two day hacking events are another popular event style. They are often free and typically run over the weekend so those no need to use up your precious holiday days. As an example the Data Science London meetup recently organized a Big Data Hackathon and next weekend Skills Matter are hosting the London GameCraft game jam.

Big Conferences

For me more interesting things happen at the edges between disciplines, so here I’m going to call out mostly multi-disciplinary conferences:


Strangeloop, if I had to recommend one conference, this would be it, this year your can see the author of Godel, Escher, Bach: an Eternal Golden Braid, Douglas Hoftadter speaking.

QCon/GOTO/Yow! conferences organized by Trifork, the team behind InfoQ, with events in San Francisco, New York, London, Aarhus, Amsterdam, Melbourne and Brisbane. I’ve attended in QCon London and a GOTO in Denmark, both were well organized with some great speakers

NDC Oslo attracted 1,600 developers this year. This conference is on my must see list, maybe next year. NDC London launches in December.

ØREDEV is based in Malmö Sweden, and attracts around 1,200 developers, this year the theme is the Arts and I’ll be giving not just one but two talks.

Build Stuff is organized by Greg Young, and based in Lithuania, it has a fantastic line-up.

MonkeySpace – there seems to be a real buzz around these conferences which focus on open source multi-platform development with .Net

If you can I’d recommend trying at least one new conference each year, this way you’ll be more likely to get exposure to new people and ideas.

Functional Conferences

Each programming language has their own conferences, for example Scala has Scala Days and the Scala eXchange (which I’ll be speaking at in December), Clojure has Euro Clojure and ClojureWest and F# has the Progressive F# Tutorials in London and New York (I’ll be there too).  There are also a number of cross-language events if you’re looking to broaden your horizons:


Lambda Jam ran in July in Chicago with a really strong line up organized by the team behind Strangeloop,

TechMesh, now CodeMesh, was a big hit in London last December, expect it to be even bigger this year.

FP Days is in its 3rd year, based in Cambridge (England), it’s a friendly intimate event.

FP eXchange is organized by Rob Pickering and brings together the London FP community.

flatMap is based in Oslo and has been running for 2 years now.

Other Conferences

Fancy trying something a little different:


That Conference is a conference and a summer camp.

CodeMash at the same location as that conference, for winter it boasts an indoor waterpark.

DDD – referencing Steve Balmer’s Developers Developers Developers chant, these free UK conferences are organized by the developer community.

Bacon is a conference on things developers love with sessions on topics including rocketry, Go, infinity, data visualisation, and continuous deployment.

GDC (Game Developers Conference) has tracks for design, production, programming and visual arts.

NIPS (Neural Information Processing Systems) you’ll learn about some really interesting machine learning projects, both research based and applied.

Conference Planner


Spring Summer Autumn Winter
QCon London NDC Oslo Strangeloop Build Stuff
FP eXchange MonkeySpace ØREDEV NDC London
GOTO Copenhagen Lambda Jam QCon San Francisco CodeMesh
GDC GOTO Amsterdam GOTO Aarhus CodeMash
Bacon QCon New York FP Days NIPS
flatMap That Conference    

I’d love to hear your event ideas and suggestions too.


Categories: F# | Scala | Clojure | Mono | .Net
Actions: E-mail | Permalink | Comments (2) | Comment RSSRSS comment feed