In the context of our Bioinformatics workflows library Biokepi, we provide an embedded domain specific language (EDSL) based on typed-tagless final interpreters. The first implementation was based on a Generalized Algebraic Data-Type (GADT) but the approach did not scale well enough, and most importantly, we really needed the EDSL to be extensible by the users of the library.
The idea is to use OCaml’s module system instead of a GADT, to provide typed EDSLs as module types and write compilers as modules matching the signature; “programs” and program transformations are then functors taking such an implementation as argument.
This talk will present the new implementation of our EDSL, while discussing advantages and limitations of the new approach and trying to be a quick tutorial on type-tagless final interpreters in OCaml.