inc-complete

Crates.ioinc-complete
lib.rsinc-complete
version0.8.1
created_at2025-06-01 13:35:12.880164+00
updated_at2025-09-28 17:28:23.304838+00
descriptionA library for writing incremental computations that re-execute the minimum number of steps when an input is changed
homepage
repositoryhttps://github.com/jfecher/inc-complete
max_upload_size
id1697182
size133,314
(jfecher)

documentation

https://docs.rs/inc-complete

README

Inc-Complete

Inc-Complete is a library for writing incremental computations that re-execute the minimum number of steps when an input is changed. Example uses:

  • Compilers: re-compile only the portion of a program which has changed
  • Spreadsheets: re-compute only formulas which rely on changed cells
  • Memoization: while this can be used for memoization, it is a rather heavy-handed solution since it also tracks dependencies across every memoized function.

Status

This library is working but in a pre-1.0 state. Expect the API to change over time. Additionally, while serialization is working, the format is not currently stable across non-bugfix releases of inc-complete. See the CHANGELOG.md for changes for each version.

Current Features

  • Load from disk
    • Manual save and load to disk to restart from where the previous program run left off
    • Just serialize and deserialize the central Db object
  • Thread-safe
  • Accumulator abstraction for collecting lists of items across computations (useful for compiler errors)
  • Cyclical dependency check - an error is issued when computations recursively depend on each other. Works even if computations are run on separate threads
  • Manually invoked garbage collection for old cached computation results

Planned Features & Roadmap

  • Support for interning arbitrary data (computations and results must currently be cloned)

Quick Start

See the docs for a quick start explanation on how to use this library.

Also see https://github.com/jfecher/modern-compiler-architecture for a full example of an incremental and concurrent compiler using inc-complete.

Commit count: 80

cargo fmt