Scala DSLs and Probabilistic Programming
summary
ScalaStan is an embedded DSL that generates Stan models from Scala and enforces correctness via the Scala type system, implicits and implicit evidence. It stages Stan types, caches compiled models for fast iteration, and runs inference with CmdStan NUTS sampling. The implementation uses type-safe programmatic generation, composable model building, and abstract interpretation to lint loops and scope checks. Practical tradeoffs: most Stan features validate at compile time but a few constructs still require fallback to raw Stan and runtime compilation.
AI-written summary · about
chapters (21)
- 0:00Scala DSLs and Probabilistic Programming
- 0:47Statistics from a Programmer's Perspective
- 2:18What is Stan?
- 3:14Example: Predicting Weight
- 7:14A More Accurate Model?
- 7:34Beyond Simple Regression
- 9:51What is an Embedded DSL?
- 10:07Why Embed the DSL?
- 14:34Overview
- 15:16Stan within the Scala Type System
- 16:06Creating Stan Types
- 17:00Stan Values
- 17:34Subclassing is Not Enough
- 19:23Implicits/Type Classes
- 21:09Operator Type-Checking Using Implicits
- 22:18Random Number Generation
- 23:19Implicits to Enforce Scope
- 23:47Using Scala Types to Check Input Data
- 26:34Detour: The State Monad
- 27:50Type Checking of Stan at Scala Run-Time
- 29:18Conclusion
related talks
15mJoeWingbermuehle
31mProbabilistic Programming: The What, Why and How
28mStan: why does it exist? when is it useful? why do I use it?
29mMotivating Probabilistic Programming
32mStructured Deep Learning with Probabilistic Neural Prog
36mProbabilistic scripts for automating common-sense tasks
24mPractical Probabilistic Programming with Figaro
22mMariaGorinova
