Skip to content

Squiggle

📋Page Status
Page Type:ResponseStyle Guide →Intervention/response page
Quality:41 (Adequate)⚠️
Importance:38.5 (Reference)
Last edited:2026-01-29 (3 days ago)
Words:1.9k
Structure:
📊 13📈 0🔗 3📚 1418%Score: 12/15
LLM Summary:Squiggle is a domain-specific probabilistic programming language optimized for intuition-driven estimation rather than data-driven inference, developed by QURI and adopted primarily in the EA community. GiveWell's quantification project using Squiggle found cost to double consumption of $169 (95% CI: $131-$1,185) compared to point estimates, demonstrating value of explicit uncertainty.
Issues (2):
  • QualityRated 41 but structure suggests 80 (underrated by 39 points)
  • Links2 links could use <R> components
DimensionAssessmentEvidence
InnovationHighFirst probabilistic language with native distribution algebra optimized for estimation
AdoptionGrowingGiveWell CEA projects (≈300 hours), AI timeline models, EA cause prioritization
Open SourceFullyMIT licensed, GitHub monorepo
IntegrationActiveSquiggleAI (Claude Sonnet 4.5), Squiggle Hub collaboration platform
Target UsersEA/RationalistsPrimarily used in effective altruism community
MaturityStableVersion 0.10.0 released January 2025 with major architectural improvements
AttributeDetails
NameSquiggle
OrganizationQURI (Quantified Uncertainty Research Institute)
Lead DeveloperOzzie Gooen
First Release2020 (Early Access)
Current Version0.10.0 (January 2025)
LicenseMIT
Websitesquiggle-language.com
GitHubgithub.com/quantified-uncertainty/squiggle
PlatformBrowser-based (JavaScript)

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.

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.

Squiggle provides native support for common probability distributions:

DistributionUse CaseExample
NormalSymmetric uncertaintiesnormal(10, 2)
LognormalPositive quantities with multiplicative uncertaintylognormal(2, 0.5)
UniformEqual probability across rangeuniform(5, 15)
BetaProbabilities between 0 and 1beta(2, 8)
TriangularThree-point estimatestriangular(5, 10, 15)
ExponentialTime between eventsexponential(0.1)
CauchyHeavy-tailed distributionscauchy(0, 1)
GammaWaiting times, ratesgamma(2, 3)

The most intuitive feature is the to operator for creating lognormal distributions:

interventionCost = 1M to 10M // Lognormal with 5th/95th percentiles
projectDuration = 6 to 24 // Months, with natural uncertainty

This equals lognormal({p5: 1M, p95: 10M}) but reads like natural language.

Mathematical operations propagate through distributions automatically via Monte Carlo sampling:

costPerUnit = 100 to 500
numberOfUnits = 1000 to 5000
totalCost = costPerUnit * numberOfUnits
// Result: automatically sampled distribution

The same distribution can be created multiple ways:

// Normal distribution - all equivalent
normal(10, 2) // mean, stdev
normal({mean: 10, stdev: 2}) // explicit
normal({p5: 5, p95: 15}) // percentile-based
normal({p10: 6, p90: 14}) // different percentiles
normal({p25: 8, p75: 12}) // quartile-based

Type-checked parameter ranges catch errors:

calculateEV(probability: [0, 1], value) = {
probability * value
}
// calculateEV(1.5, 100) → Error: probability out of range
RepresentationWhen to UseTradeoff
Sample SetDefaultSupports correlations, fast
Point SetDense numeric operationsSlower, more precise
SymbolicExact symbolic mathLimited operations

Example forcing symbolic:

Sym.normal(10, 2) // Symbolic representation
VersionDateKey Changes
0.10.0January 2025SqProject rewrite, Web Workers by default, compile-time type inference, unit type annotations, UI overhaul
0.9.4-0.9.52024Experimental Web Worker runner, version selection in playground
0.8.62024Import/export support, multi-model projects
0.8.x2023Performance improvements, Squiggle Hub integration
0.7.02023SquiggleAI integration foundations
Early Access2020Initial public release

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.

// Cost-effectiveness model for AI safety intervention
interventionCost = lognormal(1e6, 1.5) // \$1M median, high uncertainty
probabilityOfSuccess = beta(2, 8) // ~20% base rate
valueIfSuccessful = lognormal(1e12, 2) // High but uncertain value
expectedValue = probabilityOfSuccess * valueIfSuccessful
costEffectiveness = expectedValue / interventionCost
// Calculate expected value with bounded probability
calculateEV(probability: [0, 1], value) = {
adjustedProb = probability * normal(1, 0.1) // Add estimation uncertainty
truncate(adjustedProb, 0, 1) * value
}
// Use the function
projectValue = calculateEV(0.3, lognormal(1e9, 2))
// Estimate: Number of piano tuners in Chicago
chicagoPopulation = 2.7M to 2.9M
householdsPerPerson = 0.35 to 0.45
pianoOwnershipRate = 0.02 to 0.05
tuningsPerYear = 0.5 to 2
hoursPerTuning = 1.5 to 2.5
workingHoursPerYear = 1800 to 2200
totalTunings = chicagoPopulation * householdsPerPerson *
pianoOwnershipRate * tuningsPerYear
tunerCapacity = workingHoursPerYear / hoursPerTuning
numberOfTuners = totalTunings / tunerCapacity

Organizations use Squiggle for intervention comparisons with explicit uncertainty:

Use CaseExampleTypical Model Size
Charity evaluationGiveDirectly, AMF cost per life saved200-500 lines
AI safety interventionsResearch funding, field-building ROI150-400 lines
Policy cost-benefitRegulation impacts, safety standards200-600 lines
Career decisionsExpected value of different paths100-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.

Squiggle enables structured forecasts with explicit uncertainty:

ApplicationDescription
AI timeline modelsWhen will specific capabilities emerge? Probability distributions over dates
Technology adoptionS-curves with uncertainty bounds, market penetration rates
Risk scenario analysisProbability-weighted outcome trees for safety decisions
Market sizingFermi estimates for business planning with confidence intervals

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
StrengthEvidence
Simple syntaxReadable code optimized for probabilistic math
Fast prototypingQuick to write and iterate on models
Web-basedNo installation, runs in browser
Distribution algebraNatural operations on uncertain quantities
Free and openMIT license, community contributions welcome
EA adoptionStandard tool for quantitative reasoning in EA community
LimitationExplanationWorkaround
No Bayesian inferenceCannot do backwards inference from dataUse Stan/PyMC for inference problems
Slower on large modelsMuch slower than Stan or PyMC for complex modelsKeep models under ≈500 variables
Limited ecosystemFewer libraries than Python/RFocus on core estimation problems
Beta distribution displayPoor rendering when alpha or beta < 1.0Use alternative distributions
Learning curveNew syntax requires investmentStart with simple models, build up
ToolFocusStrengthsLimitationsLearning Curve
SquiggleProbabilistic estimationNative distributions, web-based, readable syntaxNo Bayesian inference, smaller ecosystemLow-Medium
GuesstimateSpreadsheet Monte CarloFamiliar spreadsheet UI, 5,000 simulationsLess programmable, limited functionsLow
StanBayesian inferencePowerful MCMC, HMC samplingSteep learning curve, slower iterationHigh
PyMCBayesian PythonFull Python ecosystem, Theano/JAX backendRequires Python expertiseMedium-High
WebPPLProbabilistic programmingInference, conditioningAcademic focus, limited toolingMedium
ExcelGeneral spreadsheetsUbiquitous, familiarPoor uncertainty support, no distributionsLow

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

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 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

While Metaforecast doesn’t directly use Squiggle, it complements the ecosystem by aggregating forecasts that can inform Squiggle model inputs.

CommunityUsage
Effective AltruismCost-effectiveness analyses, cause prioritization
Rationalist CommunityFermi estimates, decision analysis
GiveWell EvaluatorsCharity evaluation uncertainty quantification
AI Safety ResearchersTimeline modeling, intervention assessment
80,000 HoursCareer decision analysis
ResourcePurpose
EA ForumModel sharing, methodology discussions
Forecasting & Epistemics Slack#squiggle-dev channel for support
QURI SubstackUpdates and tutorials
Squiggle HubModel repository and collaboration
$100 Fermi CompetitionsIncentivized model creation
AspectDetails
Primary FunderSurvival and Flourishing Fund (SFF): $150K+ to QURI
Additional FundingFuture Fund: $100K (2022), LTFF: ongoing
Team Size≈3-5 core contributors
Development ModelOpen source with paid core team
Fiscal SponsorRethink Priorities