Squiggle 0.8

A much better editor and viewer, function annotations, and lots more

Slava and I have been busy since Squiggle 0.7. We’ve been getting ready for the Squiggle Hub, and have been making a bunch of improvements to make that experience usable.

As part of the preparation for more users, we’ve deprecated some syntax. This might break your models, so keep an eye on this (it should be easy to fix). We generally don’t intend to deprecate much between major version numbers, but this seemed like a reasonable time to make an exception.

@quri/squiggle-lang

Breaking changes

  • SampleSet distributions are now used as the default.

    • This change is important because only SampleSet distributions handle correlations, and users expecting correlations got confused when the defaults were for symbolic distributions instead. If you want to use symbolic formats, you can, like: Sym.normal(5,2).

  • a to b expressions always evaluate to lognormal distributions, limited to positive-only arguments.

  • |> pipes syntax is removed, in favor of the -> syntax.

    • We had two syntaxes that did the same thing, and wanted to clean this up.

  • # comments support is removed, in favor of the // syntax.

  • Renamed functions such as scaleLog, scalePow, etc. to Danger.mapYLog, Danger.mapYPow, etc.

    • These were infrequently used and prone to errors.

  • Default sampleCount in squiggle-lang is now 1k, matching playground.

New features

  • Parameter annotations: f(x: [0, 10]) see docs for details
  • Plot.distFn and Plot.numericFn (Plot.fn is removed)
  • Support for manual plot scales
  • Support for docstrings. /** ... */ comments are displayed in the viewer
  • List.reduceWhile function
  • Dicts and bindings are ordered
  • map callback supports an optional second index parameter
  • Support for { foo, bar } shorthand in dictionaries
  • Mixture correlations https://github.com/quantified-uncertainty/squiggle/pull/1732

Fixes

  • Exponentiation is right-associative
  • Units are whitelisted; 100blah is a syntax error
  • Fixed error message when ternary condition is wrong

Performance improvements

  • ~2x speedup on synthetic lambda-heavy benchmarks; similar improvements on real code, on average

@quri/squiggle-components

Breaking changes

  • Many @quri/squiggle-lang APIs have changed, so this package should be updated at the same time as @quri/squiggle-components
  • "Input variables" tab was removed; you can inject your JSON data directly into Squiggle instead

New features

  • Movable divider between editor and graph view
  • Support for new plots: Plot.scatter, Table.make and others
  • New default tick format. This fixes an error that small numbers (0.01) were shown as 10m; #2007.
  • Ability to "zoom in" on any variable in viewer; #1913
  • "Find in editor" button in viewer
  • Other various updates to the playground UI

Fixes

  • Display Infinity as "Infinity"
  • Fix shortcut tooltips on non-macs
  • Charts filter out infinity values from the domain
  • Improve tooltip for errors in editor

VS Code extension

  • Improvements to syntax highlighter

@quri/prettier-plugin-squiggle

Initial release. Install this package to format any Squiggle code with https://prettier.io. Requires Prettier v3.

@quri/ui

Initial release with common UI components by QURI, used in squiggle-components and Squiggle Hub. Storybook

You probably shouldn't use this package directly if you don't work at QURI, because we don't have any stability guarantees and optimize for our convenience.

Other

  • New documentation, now with search.
  • We've started work on relative values functionality in Squiggle Hub. This is still fairly error-prone, we'll work on cleaning it up in the next few months.

Full changelog here

Comments