Functional Programming Gone Wild (in the SRG)

There have been a bunch of projects related to functional programming going on in the SRG recently, and many of them relevant beyond "just" the programming language crowd.

In OCaml land, I attended the OCaml 2011 Meeting where users from all over the world get together in Paris. There is a full report on my personal blog, but overall I was struck by the sheer portability of OCaml. Highlights below...

  • Running OCaml on tiny 8-bit PIC microcontrollers! These PICs have 4-128Kb of flash (to store the code), and from 256 bytes to 4 kilobytes of RAM. Not a lot of room to waste there. There is a custom GC (150 lines of assembly), but overall it runs a lot of OCaml applications unmodified.
  • js_of_ocaml compiles OCaml bytecode directly to Javascript, with few external dependencies. Since the bytecode format changes very rarely, it is simpler to maintain than patching the compiler tool-chain. Javascript objects are mapped to dynamic OCaml objects via a light-weight ## operator, making it easy to interoperate with existing code. The compiler performs a number of dataflow optimisations to make the output Javascript efficient, and (when combined with optimisers like V8), outputs code that is nearly as efficient as hand-written Javascript.
  • I presented a work-in-progress report of our own Mirage exokernel operating system, which maps OCaml code onto specialised microkernels that run directly on Xen. Interestingly, our APIs are portable enough to also convert the same code to Javascript (using the js_of_ocaml compiler above), so expect an update shortly with a node.js to microkernel stunt...
  • I was hoping to get an update of the OCamlJava project, but Xavier Clerc couldn't make it that day. However, I was informed that the latest JVM has better support for tail calls, which raises the intriguing notion of OCaml and Scala interoperability. Perhaps a competitor for the F#/Mono combination in Java....

There were many more developments of course. Read my full review for much more.

Meanwhile, Jeff Epstein at the Computer Laboratory has written a paper with Andrew Black and Simon Peyton Jones from Microsoft Research. He has ported Erlang's programming model to Haskell, including serialised wire-level continuations for distributing computing in strongly typed Haskell. Read their paper on "Haskell for the cloud" and send them comments.

Derek Murray has also been spotted integrating our CIEL distributed execution engine with Scala on the JVM, for a full-on distributed, fault-tolerant programming experience. It's not quite ready for public distribution yet, but stay in touch for more! And while not strictly anything to do with functional programming, folks interested in multi-core issues should enjoy Malte's paper on "Condensing the Cloud" which reports on porting the CIEL engine to the non-cache coherent 48-core Intel SCC. Jeff and Malte's work demonstrate (from different angles) the value that functional programming can potentially bring to using future chip architectures that cannot maintain a coherent cache model as the number of cores rises, and message passing becomes increasingly important.

On the conference front, Yaron Minsky and I will be co-chairing the Commercial Users of Functional Programming workshop at ICFP in Tokyo this September. The event is definitely the highlight of my conference calendar: a very diverse set of academics, industrial types and web hackers all mingle and argue till the early hours. There is also an expanded tutorial series (where David Scott from Citrix and I plan to hold a session on constructing functional operating systems!), as well as BoF sessions for nailing down ideas with a smaller group of people.

The deadline for presentation proposals is June 15th (just a short abstract and bio required), so head over to the Call for Proposals and get writing! If you are curious about past events, check out the videos from previous years. Two of my personal favourite talks are Eugene Letuchy talking about how they used Erlang at Facebook to build the popular chat functionality, and Marius Eriksen describing scaling Scala for the geo-database at Twitter.

Finally, I'm on the program committee for the ML Workshop this year, also co-located with ICFP (yeah, that's a busy week). If you're doing anything interesting related to the ML family of languages, then consider submitting here to discuss your work in a friendly, informal setting. Oleg is usually present, so you might want to purchase this t-shirt for your talk though...

Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

No trackbacks yet.