# Programming Unikernels in the Large via Functor Driven Development

**Authors:** Gabriel Radanne, Thomas Gazagnaire, Anil Madhavapeddy, Jeremy Yallop,, Richard Mortier, Hannes Mehnert, Mindy Preston, David Scott

arXiv: 1905.02529 · 2019-05-08

## TL;DR

This paper introduces a modular, functor-driven development approach for large-scale unikernel applications, enabling flexible configuration and composition of components to improve efficiency and manage heterogenous deployment targets.

## Contribution

It presents a novel modular architecture using OCaml modules and signatures to manage configuration complexity in unikernel development, demonstrated within the Mirage framework.

## Key findings

- Significant efficiency improvements through compiler optimizations.
- Successful application of modular design to complex unikernel projects.
- Enhanced flexibility in managing diverse deployment configurations.

## Abstract

Compiling applications as unikernels allows them to be tailored to diverse execution environments. Dependency on a monolithic operating system is replaced with linkage against libraries that provide specific services. Doing so in practice has revealed a major barrier: managing the configuration matrix across heterogenous execution targets. A realistic unikernel application depends on hundreds of libraries, each of which may place different demands on the different target execution platforms (e.g.,~cryptographic acceleration).   We propose a modular approach to structuring large scale codebases that cleanly separates configuration, application and operating system logic. Our implementation is built on the \mirage unikernel framework, using the \ocaml language's powerful abstraction and metaprogramming facilities. Leveraging modules allows us to build many components independently, with only loose coupling through a set of standardised signatures. Components can be parameterized by other components and composed. Our approach accounts for state, dependency ordering, and error management, and our usage over the years has demonstrated significant efficiency benefits by leveraging compiler features such as global link-time optimisation during the configuration process. We describe our application architecture and experiences via some practical applications of our approach, and discuss how library development in \mirage can facilitate adoption in other unikernel frameworks and programming languages.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1905.02529/full.md

## Figures

28 figures with captions in the complete paper: https://tomesphere.com/paper/1905.02529/full.md

## References

25 references — full list in the complete paper: https://tomesphere.com/paper/1905.02529/full.md

---
Source: https://tomesphere.com/paper/1905.02529