#query #computation #experimental #salsa #framework #key #generic


A generic framework for on-demand, incrementalized computation (experimental)

4 releases

0.17.0-pre.6 Jan 23, 2024
0.17.0-pre.5 Jan 10, 2024
0.17.0-pre.4 Dec 7, 2023
0.17.0-pre.3 Nov 25, 2023

#136 in Development tools

Download history 5503/week @ 2024-01-28 8310/week @ 2024-02-04 2420/week @ 2024-02-11 1565/week @ 2024-02-18 2627/week @ 2024-02-25 2345/week @ 2024-03-03 2245/week @ 2024-03-10 2468/week @ 2024-03-17 2789/week @ 2024-03-24 2637/week @ 2024-03-31 2603/week @ 2024-04-07 2411/week @ 2024-04-14 2986/week @ 2024-04-21 2343/week @ 2024-04-28 1582/week @ 2024-05-05 1459/week @ 2024-05-12

8,774 downloads per month
Used in 6 crates (via cargo-modules)

Apache-2.0 OR MIT



Test Book Released API docs Crates.io

A generic framework for on-demand, incrementalized computation.

Obligatory warning

Very much a WORK IN PROGRESS at this point. Ready for experimental use but expect frequent breaking changes.


This system is heavily inspired by adapton, glimmer, and rustc's query system. So credit goes to Eduard-Mihai Burtescu, Matthew Hammer, Yehuda Katz, and Michael Woerister.

Key idea

The key idea of salsa is that you define your program as a set of queries. Every query is used like function K -> V that maps from some key of type K to a value of type V. Queries come in two basic varieties:

  • Inputs: the base inputs to your system. You can change these whenever you like.
  • Functions: pure functions (no side effects) that transform your inputs into other values. The results of queries is memoized to avoid recomputing them a lot. When you make changes to the inputs, we'll figure out (fairly intelligently) when we can re-use these memoized values and when we have to recompute them.

Want to learn more?

To learn more about Salsa, try one of the following:

Getting in touch

The bulk of the discussion happens in the issues and pull requests, but we have a zulip chat as well.


~57K SLoC