Modularity 2016
Mon 14 - Thu 17 March 2016 Spain
Tue 15 Mar 2016 14:00 - 14:30 at CROW - CROW Workshop Session 2

In this paper, we investigate the use of F# compile-time metaprogramming techniques to enable developing type-safe, reactive client-server applications with seamless server-side persistence using WebSharper, a mature F# web framework. Next to the two-way binding between client-side data models and their corresponding presentation, the reactive data models in our work can also express the details of server-side persistence and synchronization, using a modular approach and a strongly-typed communication channel over web sockets with communicating agents between the two tiers.

The work presented also enables using annotated HTML markup templates, translated by an F# type provider to our statically-typed reactive data models. This way, the design artifacts can be externalized into native HTML that designers can easily work with, and markup changes are checked against the F# code base at compile time.

We demonstrate the combination of these techniques with a data-aware single-page client-server chat application, expressed entirely in F#. We find that type safety, the uniform F# programming model, and the reactive design around data binding, synchronization, and persistence greatly enhances developer productivity.