Computer Laboratory

OCaml Labs

Illuminate

Embedded computer systems that are low-power, physically mobile, and which contain actuators and sensors to interface and influence the "real world" are becoming increasingly common.
Many people are referring to this collectively as the "Internet of Things". We're building the core technology to make these distributed devices fundamentally more secure, reliable and easier to program. This consists of three main bits of technology:

  • The Mirage OS (described separately) to build specialised, type-safe embedded images.
  • The Signposts coordination system for embedded devices to find each other securely across a complex edge network.
  • The Irminsule (described in T2) persistent storage system to provide a flexible coordination workflow across such sensors.

A key first use case for here is revolutionising lighting systems. Over the next decade or so, lighting systems in buildings all over the world will shift to using more energy efficient LEDs in place of traditional tungsten bulbs or fluorescent tubes. As well as the important reduction in energy usage, this transition opens up unprecedented opportunities for both lighting circuit design and embedded systems.

Due to the nature of LEDs, it's feasible to consider deploying ubiquitous sensor networks alongside the LED lighting in a building. Since issues of power and communication are straightforward to tackle, such a network would allow completely new types of applications and services to be developed. In addition, there would also be a dramatic impact on the relationship between people and the building.

We're creating this platform to allow others to build technology and services based on such distributed networks. Such a platform tackles the questions surrounding security, reliability, and accountability while working with industry to enable new services.

Team

Tasks

Sep '12Oct '12Nov '12Dec '12Jan '13Feb '13Mar '13Apr '13May '13Jun '13Jul '13Aug '13Sep '13Oct '13Nov '13Dec '13Jan '14Feb '14Mar '14Apr '14
Heidi Howard Signpost prototype
Daniel Bünzli Declarative graphing library
Anil Madhavapeddy Raspberry OCaml
 

Signpost prototype

Complete by Heidi Howard (Aug 2012 - Jun 2013)
USENIX FOCI 2013  


Declarative graphing library

Complete by Daniel Bünzli (Apr 2013 - Jul 2013)
Gg library   Vg library  

Vg is a declarative 2D vector graphics library for OCaml. It's a baseline library with multiple output backends like PDF, SVG or the HTML5 Canvas element. This project aims to build a "Tufte principled" 2D visualization library with some simple graphing widgets for data visualisation. In the longer term, the intention is to build a declarative UI framework also.

Related work


Raspberry OCaml

Complete by Anil Madhavapeddy (Nov 2012 - Feb 2013)
Bug report   Jane Street blog  

The Raspberry Pi has an ARMv6 processor, and there are two main distributions available. Debian wheezy is compiled with soft float (which emulates floating point) and is fairly compatible with most software. The Raspbian distribution is recompiled to take advantage of hard float, which is faster but requires a new set of binary packages.

Soft-float Debian: If you use soft-float Debian, there is a nice guide available on the Jane Street OCaml blog blog on how to bootstrap the native code OCaml compiler on it. The standard binary packages included with Debian will also work fine.

Hard-float Raspbian: Once you have Raspbian installed, the byte-code ocamlc compiler will work, but the ocamlopt native code compiler doesnt work out of the box. This is due to differences in the ARMv6 and ARMv7 instruction setsa .The Raspbian distribution uses a calling convention called VFPE2 to handle floating point, and OCaml doesn't recognise it by default.

Luckily, the issue has been fixed upstream in the OCaml compiler, and will appear in version 4.00.2. Meanwhile, you can download precompiled debs with this patch by adding the following to /etc/apt/sources.list:

deb http://www.cl.cam.ac.uk/~lpw25/ocaml-rpi/ wheezy main
deb-src http://www.cl.cam.ac.uk/~lpw25/ocaml-rpi/ wheezy main

Alternatively, you can also use OPAM to compile a custom compiler (see the Jane Street blog post above for instructions on how to install OPAM):

$ opam switch 4.00.1+raspberrypi
$ eval `opam config -env`

This compiler should work on Raspbian with no issues. Many thanks to Jeffery Scofield for all this help with this patch!