Skip to content
Longterm Wiki

Introduction | Squiggle

web
squiggle-language.com·squiggle-language.com/docs

Metadata

Cited by 1 page

PageTypeQuality
SquiggleProject41.0

Cached Content Preview

HTTP 200Fetched May 24, 20264 KB
On this page Introduction

 Squiggle is a minimalist programming language for probabilistic estimation. It's meant for intuitively-driven quantitative estimation instead of data analysis or data-driven statistical techniques.

 The basics of Squiggle are fairly straightforward. This can be enough for many models. The more advanced functionality can take some time to learn.

 A Simple Example 

 Say you're trying to estimate the number of piano tuners in New York City. You can build a simple model of this, like so.

 Tip 

This editor is interactive! Try changing the code.

 
 
 
 Now let's take this a bit further. Let's imagine that you think that NYC will grow over time, and you'd like to estimate the number of piano tuners for every point in time for the next few years.

 
 Using Squiggle 

 You can currently interact with Squiggle in a few ways:

 Squiggle Hub 

 Squiggle Hub is a platform for the creation and sharing of code written in Squiggle. It's a great way to get started with Squiggle or to share your models with others.

 Playground 

 The Squiggle Playground is a nice tool for working with small models and making prototypes. You can make simple shareable links, but you can't save models that change over time.

 Visual Studio Code Extension 

 There's a simple VS Code extension for running and visualizing Squiggle code. We find that VS Code is a useful editor for managing larger Squiggle setups.

 Typescript Library 

 Squiggle is built using Typescript , and is accessible via a simple Typescript library. You can use this library to either run Squiggle code in full, or to call select specific functions within Squiggle.

 React Components Library 

 All of the components used in the playground and documentation are available in a separate component NPM repo. You can see the full Storybook of components here .

 Observable 

 You can use Squiggle Components in Observable notebooks. Sam Nolan put together an exportable Observable Notebook of the key components that you can directly import and use in your Observable notebooks.

 Squiggle Vs. Other Tools 

 What Squiggle Is 

 
 A simple programming language for doing math with probability distributions.

 An embeddable language that can be used in Javascript applications.

 A tool to encode functions as forecasts that can be embedded in other applications.

 
 What Squiggle Is Not 

 
 A complete replacement for enterprise Risk Analysis tools. (See Crystal Ball , @Risk , Lumina Analytica )

 A probabilistic programming language . Squiggle does not support Bayesian inference.

 A tool for substantial data analysis. (See programming languages like Python or Julia )

 A programming language for anything other than estimation.

 A visually-driven tool. (See Guesstimate and Causal )

 
 Strengths 

 
 Simple and readable syntax, especially for dealing with probabilistic math.

 Fast for relatively small models. Strong for rapid prototyping.

 Optimized fo

... (truncated, 4 KB total)
Resource ID: 78f6eb033f5c613e | Stable ID: sid_rKfiJjRsdw