Crate adapton [] [src]

Adapton for Rust

This Rust implementation embodies the latest implementation Adapton, which offers a foundational, language-based semantics for general-purpose incremental computation.

Programming interface in Rust: For an overview of its Rust programming interface, see the documentation for the adapton::macros module, which wraps the adapton::engine module with some convenient macros.

See also:


Adapton proposes the demanded computation graph (or DCG), and a demand-driven change propagation algorithm. Further, it proposes first-class names for identifying cached data structures and computations.

The following academic papers detail these technical proposals:

Why Rust?

Adapton's first implementations used Python and OCaml; The latest implementation in Rust offers the best performance thus far, since (1) Rust is fast, and (2) traversal-based garbage collection presents performance challenges for incremental computation. By liberating Adapton from traversal-based collection, our empirical results are both predictable and scalable.



Experimental collections, including those for sequences and sets. (See also: The IODyn crate)


Adapton's core calculus, implemented as a runtime library. We implement two versions of this interface, which we refer to as engines: The naive engine and the DCG engine, implemented based on the algorithms from the Adapton papers.


Macros to make using the engine module's interface more ergonomic.


Parses the output of Rust Debug strings into reflected values of type Val. (See engine::reflect module).


Reflects the DCG engine, including both the effects of the programs running in it, and the internal effects of the engine cleaning and dirtying the DCG. For the latter effects, see the trace module.



Convenience wrapper for engine::cell


Convenience wrapper: Call a function and place the result into an engine::cell.


Similar to memo!, except return both the thunk and its observed (forced) value.


Convenience wrapper for engine::force


Convenience wrapper for engine::thunk and engine::force: creates a thunk and immediately forces it.


Generate a "program point", used as a unique ID for memoized functions.


Convenience wrapper for engine::thunk