Skip to content

jfecher/inc-complete

Repository files navigation

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
  • Fast - see https://github.com/jfecher/incremental-benchmark
  • 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.

About

A library for incremental computations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages