home Anil Madhavapeddy, Professor of Planetary Computing  

Bidirectional Hazel to OCaml programming

This is an idea proposed in 2025 as a good starter project, and is under discussion with a student but not yet confirmed. It may be co-supervised with Patrick Ferris and Cyrus Omar.

Hazel is a pure subset of OCaml with a live functional programming environment that is able to typecheck, manipulate, and even run incomplete programs. As a pure language with no effects, Hazel is a great choice for domains such as configuration languages where some control flow is needed, but not the full power of a general purpose programming language. On the other hand, Hazel only currently has an interpreter and so is fairly slow to evaluate compared to a full programming language such as OCaml.

This summer project aims to do two things:

Once we can go back and forth, we can explore some interesting domains where this is useful. For example, can we build a configuration language frontend in Hazel, and then directly convert that into OCaml code for embedding into an application? Could we build a simple blog/wiki frontend where layout is expressed in livelit Hazel, and then when ready is converted to OCaml for publishing on the web?

We don't know if any of this will work, but we'd like to explore this "context switching" between languages of different expressivity in order to explore the divide between interactive, exploratory programming, and high performance and more static published code.

# 1st Apr 2025   iconideas functional hazel idea-beginner idea-discuss javascript ocaml types wasm

Related News