Squiggle
- QualityRated 41 but structure suggests 80 (underrated by 39 points)
- Links2 links could use <R> components
Quick Assessment
Section titled “Quick Assessment”| Dimension | Assessment | Evidence |
|---|---|---|
| Innovation | High | First probabilistic language with native distribution algebra optimized for estimation |
| Adoption | Growing | GiveWell CEA projects (≈300 hours), AI timeline models, EA cause prioritization |
| Open Source | Fully | MIT licensed, GitHub monorepo |
| Integration | Active | SquiggleAI (Claude Sonnet 4.5), Squiggle Hub collaboration platform |
| Target Users | EA/Rationalists | Primarily used in effective altruism community |
| Maturity | Stable | Version 0.10.0 released January 2025 with major architectural improvements |
Project Details
Section titled “Project Details”| Attribute | Details |
|---|---|
| Name | Squiggle |
| Organization | QURIOrganizationQURI (Quantified Uncertainty Research Institute)QURI develops Squiggle (probabilistic programming language with native distribution types), SquiggleAI (Claude-powered model generation producing 100-500 line models), Metaforecast (aggregating 2,1...Quality: 48/100 (Quantified Uncertainty Research Institute) |
| Lead Developer | Ozzie Gooen |
| First Release | 2020 (Early Access) |
| Current Version | 0.10.0 (January 2025) |
| License | MIT |
| Website | squiggle-language.com |
| GitHub | github.com/quantified-uncertainty/squiggle |
| Platform | Browser-based (JavaScript) |
Overview
Section titled “Overview”Squiggle is a domain-specific programming language designed specifically for probabilistic estimation and uncertainty quantification. Unlike general-purpose probabilistic programming languages (PPLs) like Stan or PyMC that focus on Bayesian inference from data, Squiggle is optimized for situations where there is very little data available and most variables must be intuitively estimated by domain experts.
The language provides first-class support for probability distributions, enabling analysts to express complex uncertainties naturally. Operations that would require dozens of lines in Python + NumPy can be expressed in single lines of Squiggle. For example, multiplying two uncertain quantities is as simple as normal(10, 2) * uniform(0.8, 1.2).
Squiggle is meant for intuitively-driven quantitative estimation rather than data analysis or data-driven statistical techniques. This design focus makes it particularly well-suited for:
- Fermi estimates: Breaking down complex questions into component estimates
- Cost-effectiveness analyses: Comparing interventions with explicit uncertainty
- Forecasting models: AI timelines, technology adoption curves
- Decision analysis: Career choices, resource allocation under uncertainty
The language runs entirely in the browser via JavaScript, requiring no installation or backend infrastructure. This accessibility has made it the standard tool for quantitative reasoning in the effective altruism community.
Design Philosophy
Section titled “Design Philosophy”Squiggle’s syntax is forked from earlier tools Guesstimate and Foretold, optimized for readable probabilistic expressions. It can be thought of as similar to SQL or Excel: there are simple ways to declare variables and write functions, but don’t expect classes, inheritance, or monads. This intentional simplicity keeps the learning curve manageable while providing enough expressiveness for sophisticated models.
The language is designed around the insight that domain experts frequently struggle with basic programming requirements even when they have deep knowledge of the problem domain. Squiggle aims to minimize the programming friction between an expert’s mental model and executable code.
Core Features
Section titled “Core Features”Distribution Types
Section titled “Distribution Types”Squiggle provides native support for common probability distributions:
| Distribution | Use Case | Example |
|---|---|---|
| Normal | Symmetric uncertainties | normal(10, 2) |
| Lognormal | Positive quantities with multiplicative uncertainty | lognormal(2, 0.5) |
| Uniform | Equal probability across range | uniform(5, 15) |
| Beta | Probabilities between 0 and 1 | beta(2, 8) |
| Triangular | Three-point estimates | triangular(5, 10, 15) |
| Exponential | Time between events | exponential(0.1) |
| Cauchy | Heavy-tailed distributions | cauchy(0, 1) |
| Gamma | Waiting times, rates | gamma(2, 3) |
The “to” Syntax
Section titled “The “to” Syntax”The most intuitive feature is the to operator for creating lognormal distributions:
interventionCost = 1M to 10M // Lognormal with 5th/95th percentilesprojectDuration = 6 to 24 // Months, with natural uncertaintyThis equals lognormal({p5: 1M, p95: 10M}) but reads like natural language.
Distribution Algebra
Section titled “Distribution Algebra”Mathematical operations propagate through distributions automatically via Monte Carlo sampling:
costPerUnit = 100 to 500numberOfUnits = 1000 to 5000totalCost = costPerUnit * numberOfUnits// Result: automatically sampled distributionMultiple Parameterizations
Section titled “Multiple Parameterizations”The same distribution can be created multiple ways:
// Normal distribution - all equivalentnormal(10, 2) // mean, stdevnormal({mean: 10, stdev: 2}) // explicitnormal({p5: 5, p95: 15}) // percentile-basednormal({p10: 6, p90: 14}) // different percentilesnormal({p25: 8, p75: 12}) // quartile-basedFunctions with Domain Constraints
Section titled “Functions with Domain Constraints”Type-checked parameter ranges catch errors:
calculateEV(probability: [0, 1], value) = { probability * value}// calculateEV(1.5, 100) → Error: probability out of rangeThree Internal Representations
Section titled “Three Internal Representations”| Representation | When to Use | Tradeoff |
|---|---|---|
| Sample Set | Default | Supports correlations, fast |
| Point Set | Dense numeric operations | Slower, more precise |
| Symbolic | Exact symbolic math | Limited operations |
Example forcing symbolic:
Sym.normal(10, 2) // Symbolic representationVersion History
Section titled “Version History”| Version | Date | Key Changes |
|---|---|---|
| 0.10.0 | January 2025 | SqProject rewrite, Web Workers by default, compile-time type inference, unit type annotations, UI overhaul |
| 0.9.4-0.9.5 | 2024 | Experimental Web Worker runner, version selection in playground |
| 0.8.6 | 2024 | Import/export support, multi-model projects |
| 0.8.x | 2023 | Performance improvements, Squiggle Hub integration |
| 0.7.0 | 2023 | SquiggleAI integration foundations |
| Early Access | 2020 | Initial public release |
Squiggle 0.10.0 Deep Dive
Section titled “Squiggle 0.10.0 Deep Dive”The January 2025 release represented six months of development with significant architectural changes:
Web Workers: All Squiggle code now runs in a separate Web Worker thread by default, with results marshaled back asynchronously. This prevents UI freezes during complex calculations and improves the user experience for large models.
Type System: New compile-time type inference transforms the AST to a typed AST, enabling earlier error detection. The pipeline now includes semantic analysis for type checks before execution.
Unit Type Annotations (experimental, contributed by Michael Dickens): Variables can be annotated with physical units like kilograms, dollars, or compound units like m/s^2. This helps catch dimensional analysis errors.
UI Changes: The output viewer now defaults to collapsed variables. Use the @startOpen decorator to expand variables by default for important outputs.
Code Examples
Section titled “Code Examples”Basic Cost-Effectiveness Model
Section titled “Basic Cost-Effectiveness Model”// Cost-effectiveness model for AI safety interventioninterventionCost = lognormal(1e6, 1.5) // \$1M median, high uncertaintyprobabilityOfSuccess = beta(2, 8) // ~20% base ratevalueIfSuccessful = lognormal(1e12, 2) // High but uncertain value
expectedValue = probabilityOfSuccess * valueIfSuccessfulcostEffectiveness = expectedValue / interventionCostFunction with Domain Constraints
Section titled “Function with Domain Constraints”// Calculate expected value with bounded probabilitycalculateEV(probability: [0, 1], value) = { adjustedProb = probability * normal(1, 0.1) // Add estimation uncertainty truncate(adjustedProb, 0, 1) * value}
// Use the functionprojectValue = calculateEV(0.3, lognormal(1e9, 2))Multi-Variable Fermi Estimate
Section titled “Multi-Variable Fermi Estimate”// Estimate: Number of piano tuners in ChicagochicagoPopulation = 2.7M to 2.9MhouseholdsPerPerson = 0.35 to 0.45pianoOwnershipRate = 0.02 to 0.05tuningsPerYear = 0.5 to 2hoursPerTuning = 1.5 to 2.5workingHoursPerYear = 1800 to 2200
totalTunings = chicagoPopulation * householdsPerPerson * pianoOwnershipRate * tuningsPerYeartunerCapacity = workingHoursPerYear / hoursPerTuningnumberOfTuners = totalTunings / tunerCapacityUse Cases
Section titled “Use Cases”Cost-Effectiveness Analysis
Section titled “Cost-Effectiveness Analysis”Organizations use Squiggle for intervention comparisons with explicit uncertainty:
| Use Case | Example | Typical Model Size |
|---|---|---|
| Charity evaluation | GiveDirectly, AMF cost per life saved | 200-500 lines |
| AI safety interventions | Research funding, field-building ROI | 150-400 lines |
| Policy cost-benefit | Regulation impacts, safety standards | 200-600 lines |
| Career decisions | Expected value of different paths | 100-300 lines |
The GiveWell CEA quantification project demonstrated that Squiggle can make charity evaluations more transparent by showing full probability distributions rather than point estimates. The project involved approximately 300 hours of work to quantify uncertainty in GiveWell’s cost-effectiveness analyses.
Key Finding: When adding uncertainty to GiveWell’s GiveDirectly analysis, Sam Nolan found a mean cost to double consumption of $169 (95% CI: $131-$1,185), compared to GiveWell’s point estimate. This shows how uncertainty quantification affects decision-making.
Forecasting Models
Section titled “Forecasting Models”Squiggle enables structured forecasts with explicit uncertainty:
| Application | Description |
|---|---|
| AI timeline models | When will specific capabilities emerge? Probability distributions over dates |
| Technology adoption | S-curves with uncertainty bounds, market penetration rates |
| Risk scenario analysis | Probability-weighted outcome trees for safety decisions |
| Market sizing | Fermi estimates for business planning with confidence intervals |
Research Communication
Section titled “Research Communication”Squiggle models embedded in publications enable:
- Transparent assumptions: Every input visible and adjustable by readers
- Reproducible calculations: Same code produces same outputs across platforms
- Interactive exploration: Readers can modify parameters to test sensitivity
- Sensitivity analysis: Identify which inputs matter most through visualization
Strengths and Limitations
Section titled “Strengths and Limitations”Strengths
Section titled “Strengths”| Strength | Evidence |
|---|---|
| Simple syntax | Readable code optimized for probabilistic math |
| Fast prototyping | Quick to write and iterate on models |
| Web-based | No installation, runs in browser |
| Distribution algebra | Natural operations on uncertain quantities |
| Free and open | MIT license, community contributions welcome |
| EA adoption | Standard tool for quantitative reasoning in EA community |
Limitations
Section titled “Limitations”| Limitation | Explanation | Workaround |
|---|---|---|
| No Bayesian inference | Cannot do backwards inference from data | Use Stan/PyMC for inference problems |
| Slower on large models | Much slower than Stan or PyMC for complex models | Keep models under ≈500 variables |
| Limited ecosystem | Fewer libraries than Python/R | Focus on core estimation problems |
| Beta distribution display | Poor rendering when alpha or beta < 1.0 | Use alternative distributions |
| Learning curve | New syntax requires investment | Start with simple models, build up |
Comparison with Alternatives
Section titled “Comparison with Alternatives”| Tool | Focus | Strengths | Limitations | Learning Curve |
|---|---|---|---|---|
| Squiggle | Probabilistic estimation | Native distributions, web-based, readable syntax | No Bayesian inference, smaller ecosystem | Low-Medium |
| Guesstimate | Spreadsheet Monte Carlo | Familiar spreadsheet UI, 5,000 simulations | Less programmable, limited functions | Low |
| Stan | Bayesian inference | Powerful MCMC, HMC sampling | Steep learning curve, slower iteration | High |
| PyMC | Bayesian Python | Full Python ecosystem, Theano/JAX backend | Requires Python expertise | Medium-High |
| WebPPL | Probabilistic programming | Inference, conditioning | Academic focus, limited tooling | Medium |
| Excel | General spreadsheets | Ubiquitous, familiar | Poor uncertainty support, no distributions | Low |
When to Use Squiggle
Section titled “When to Use Squiggle”Use Squiggle when:
- You need intuition-driven estimation without much data
- Rapid prototyping of uncertainty models is priority
- Web-based sharing and collaboration is important
- You want readable, auditable probabilistic code
- Target audience is EA/rationalist community
Use Stan/PyMC when:
- You have data and need Bayesian inference
- Model complexity requires advanced MCMC methods
- Performance on large models is critical
- You need full scientific computing ecosystem
Use Guesstimate when:
- Spreadsheet interface is strongly preferred
- Quick one-off calculations suffice
- Non-programmers need to contribute directly
Integration with QURI Ecosystem
Section titled “Integration with QURI Ecosystem”Squiggle Hub
Section titled “Squiggle Hub”Squiggle Hub provides:
- Model hosting with public/private visibility
- Git-like version control
- Multi-model projects with imports/exports
- Collaboration features
- Access to 17,000+ Guesstimate models
SquiggleAI
Section titled “SquiggleAI”SquiggleAIConceptSquiggleAISquiggleAI is an LLM tool (primarily Claude Sonnet 4.5) that generates probabilistic Squiggle models from natural language, using ~20K tokens of cached documentation to produce 100-500 line models ...Quality: 37/100 integrates LLMs for:
- Natural language to Squiggle code generation
- Model debugging and explanation
- Iterative refinement through conversation
- Uses Claude Sonnet 4.5 with 20K token context caching
Metaforecast
Section titled “Metaforecast”While MetaforecastConceptMetaforecastMetaforecast is a forecast aggregation platform combining 2,100+ questions from 10+ sources (Metaculus, Manifold, Polymarket, etc.) with daily updates via automated scraping. Created by QURI, it pr...Quality: 35/100 doesn’t directly use Squiggle, it complements the ecosystem by aggregating forecasts that can inform Squiggle model inputs.
Community and Adoption
Section titled “Community and Adoption”Primary User Base
Section titled “Primary User Base”| Community | Usage |
|---|---|
| Effective Altruism | Cost-effectiveness analyses, cause prioritization |
| Rationalist Community | Fermi estimates, decision analysis |
| GiveWell Evaluators | Charity evaluation uncertainty quantification |
| AI Safety Researchers | Timeline modeling, intervention assessment |
| 80,000 Hours | Career decision analysis |
Community Resources
Section titled “Community Resources”| Resource | Purpose |
|---|---|
| EA Forum | Model sharing, methodology discussions |
| Forecasting & Epistemics Slack | #squiggle-dev channel for support |
| QURI Substack | Updates and tutorials |
| Squiggle Hub | Model repository and collaboration |
| $100 Fermi Competitions | Incentivized model creation |
Funding and Development
Section titled “Funding and Development”| Aspect | Details |
|---|---|
| Primary Funder | Survival and Flourishing Fund (SFF): $150K+ to QURI |
| Additional Funding | Future Fund: $100K (2022), LTFF: ongoing |
| Team Size | ≈3-5 core contributors |
| Development Model | Open source with paid core team |
| Fiscal Sponsor | Rethink Priorities |