Embedded Probabilistic Programming
Source: Rutgers University
Two general techniques for implementing a Domain-Specific Language (DSL) with less overhead are the finally-tagless embedding of object programs and the direct-style representation of side effects. The authors use these techniques to build a DSL for probabilistic programming, for expressing countable probabilistic models and performing exact inference and importance sampling on them. Their language is embedded as an ordinary OCaml library and represents probability distributions as ordinary OCaml programs. They use delimited continuations to reify probabilistic programs as lazy search trees, which inference algorithms may traverse without imposing any interpretive overhead on deterministic parts of a model.