YAPPL: Yet Another Probabilistic Programming Language

YAPPL is a language built around the idea that probability should be a first-class concern of the language itself, not something the programmer has to bolt on with manual bookkeeping. It provides a small toolkit of features designed to make writing and analysing randomised algorithms more ergonomic.

Core Features
  • Distributions are values: Construct them, combine them with arithmetic, and query them analytically before sampling.
  • Probabilistic functions: Declare one with an error class (RP, coRP, or BPP) and the runtime automatically amplifies confidence to a programmer-specified target.
  • Late (or late-as-possible) sampling: The language is designed so that as much work as possible happens at the distribution level, and concrete values are extracted only at the end.
  • Composition: map, bind, and step let you build larger probabilistic computations from smaller ones — including typed Markov chains over user-defined enums.
Try the examples on the left
  • Fair Die, Two Dice Sum: distributions as first-class values.
  • Bernoulli, Binomial, Geometric: built-in distribution constructors.
  • Solovay-Strassen Primality, Fermat Compositeness: RP and coRP primality tests with confidence amplification.
  • Bias Detection (BPP): two-sided error and majority-vote amplification.
  • Prime Sieve (map): apply a probabilistic function to an array under a shared confidence budget.
  • Underlying Distribution (distribution_of): extract the analytical, empirical, or Bayesian distribution of a probabilistic function.

For the full grammar, semantics, and feature reference, see the Language Specification linked from Docs.

Output will appear here...