/ Ideas / Functional Reactive Web Applications

This is an idea proposed in 2010 as a Cambridge Computer Science Part II project, and has been completed by Henry Hughes. It was supervised by Anil Madhavapeddy as part of my OCaml Labs project.

Summary

There are a variety of programming languages which can be used to create desktop applications, and each provides different tradeoffs. This could be anything from the runtime guarantees the programming language provides to rapid development and prototyping. It does not make much difference to the user which of these languages was used, as all they want to do is run their favourite application reliably.

When writing an application for the web, however, the programmer is forced to use a specific set of APIs that come under the umbrella term AJAX (Asynchronous JavaScript and XML). AJAX involves writing client-side code in JavaScript and performing asynchronous requests to a server. This provides a more interactive environment than the classical web application model. The classical model uses the server to create the next web page on the fly and then reloads the current page with the new one. This is often less desirable because loading a new page causes a break in the user’s work flow.

While JavaScript is a full-featured language there are other programming languages which provide features for more robust coding. This project explores how AJAX applications might be written using a paradigm known as functional reactive programming, and implement it in the OCaml language and compile it to JavaScript via the ocamljs transpiler. The project uses the froc FRP library by Jake Donham.

Related Reading

Links

The dissertation PDF isn't available publically but should be in the Cambridge Computer Lab archives somewhere. The source code is also archived but not publically available.

Related Ideas