| Crates.io | fugue-ppl |
| lib.rs | fugue-ppl |
| version | 0.1.0 |
| created_at | 2025-09-01 21:41:01.77073+00 |
| updated_at | 2025-09-01 21:41:01.77073+00 |
| description | Production-ready monadic PPL with numerically stable inference, comprehensive diagnostics, and memory optimization. |
| homepage | |
| repository | https://github.com/alexandernodeland/fugue-ppl |
| max_upload_size | |
| id | 1820298 |
| size | 1,079,366 |
A production-ready, monadic probabilistic programming library for Rust. Write elegant probabilistic programs by composing Model values in direct style; execute them with pluggable interpreters and state-of-the-art inference algorithms.
Supported Rust: 1.70+ ⢠Platforms: Linux / macOS / Windows ⢠Crate:
fugue-pplon crates.io
prob!), vectorization (plate!), addressing (addr!)bool, Poisson/Binomial ā u64, Categorical ā usize)Model<T> values with bind/map for explicit, readable control flow[dependencies]
fugue-ppl = "0.1.0"
cargo add fugue-ppl
use fugue::*;
use rand::rngs::StdRng;
use rand::SeedableRng;
// Run inference with model defined in closure
let mut rng = StdRng::seed_from_u64(42);
let samples = adaptive_mcmc_chain(&mut rng, || {
prob! {
let mu <- sample(addr!("mu"), Normal::new(0.0, 1.0).unwrap());
observe(addr!("y"), Normal::new(mu, 0.5).unwrap(), 1.2);
pure(mu)
}
}, 1000, 500);
let mu_values: Vec<f64> = samples.iter()
.filter_map(|(_, trace)| trace.get_f64(&addr!("mu")))
.collect();
examples/ directoryenhancement labelThis project is an ongoing exploration of probabilistic programming in Rust. While many pieces are production-leaning, parts may not be 100% complete or correct yet. Iām steadily working toward a more robust implementation and broader feature set.
Planned focus areas:
Contributions welcome! See our contributing guidelines.
git clone https://github.com/alexandernodeland/fugue.git
cd fugue && cargo test
Licensed under the MIT License.
Built with Rust ⢠Monadic PPL ⢠Type-safe distributions