Skip to content

Three new domain-specific (embedded) languages with a Stan backend

One is an accident. Two is a coincidence. Three is a pattern.

Perhaps it’s no coincidence that there are three new interfaces that use Stan’s C++ implementation of adaptive Hamiltonian Monte Carlo (currently an updated version of the no-U-turn sampler).

  • ScalaStan embeds a Stan-like language in Scala. It’s a Scala package largely (if not entirely written by Joe Wingbermuehle.
    [GitHub link]

  • tmbstan lets you fit TMB models with Stan. It’s an R package listing Kasper Kristensen as author.
    [CRAN link]

  • SlicStan is a “blockless” and self-optimizing version of Stan. It’s a standalone language coded in F# written by Maria Gorinova.
    [pdf language spec]

These are in contrast with systems that entirely reimplement a version of the no-U-turn sampler, such as PyMC3, ADMB, and NONMEM.


  1. Andrew says:

    Cool! By the way, we had a blog commenter awhile ago who wrote that StataStan is hard to use. The commenter didn’t provide any details. Has anyone else heard this?

  2. Dustin Tran says:

    I attended a talk Maria gave today at PPS ( It was very interesting. One powerful application (which wasn’t noted) is to use SlicStan as an intermediate target between, say, Edward (or PyMC3) and Stan. Given a program in Edward or PyMC3, declaration blocks for purely data, parameters, and generated quantities are much easier to transform to; then SlicStan’s translation rules can transform it into the specific blocks for use in Stan algorithms. On the other side, I guess transforming a program in Stan -> SlicStan -> Edward could be useful for generating from the model(?).

Leave a Reply