Expand description
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.
See also: The main module demonstrates the Adapton programming model with examples.
Modules§
- manage
- Operations that monitor and alter the active engine. Incremental applications should not use these operations directly.
- reflect_
dcg - 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
tracemodule.
Structs§
- Art
- Articulations: for incrementally-changing data/computation.
- DCG
- (DCG) Demanded Computation Graph: The cache of past computation.
- Flags
- Flags control runtime behavior of the DCG.
- Name
- Names: First-class data that identifies a mutable cell (see
cell) or a thunk (seethunk). When a name identifies different content over time, it describes where incremental changing is occurring, relative to other (unaffected) parts of data structures or computations.
Enums§
- Engine
- The engine API works in two modes:
NaiveandDCG. ANaiveengine is stateless, whereas theDCGis stateful. - Name
Choice - A
NameChoicechooses betweenNative,StructuralandNominalidentities for articulation points introduced bythunk.
Traits§
- AbsMap
Fam - A family of mappings, with a notion of member subsets via abstract
mappings. These abstractions compress sequences of observations
into a single DCG force edge. See also:
force_abs.
Functions§
- cell
- Creates a named reference cell (an eager
Art<_>) whose content can change over time. - force
- Demands and observes the value of an
&Art<T>, returning a (cloned) value of typeT. - force_
abs - Demand & observe arts, through an abstracted mapping function (See
AbsMapFamtrait) - force_
cycle - Demands and observes the value of an
&Art<T>, returning a (cloned) value of typeT, or the value ofcycle_outif the force edge forms a cycle in the DCG. - force_
map - Demands and observes the value of an
&Art<T>, returning a (cloned) value of typeS, mapped by functionmapf. - name_
fork - Create two names from one
- name_
fork3 - Create three names from one
- name_
fork4 - Create four names from one
- name_
of_ hash64 - Create a name from a hash value.
- name_
of_ isize - Create a name from a
isize - name_
of_ str - Create a name from a
str - name_
of_ string - Create a name from a
string - name_
of_ usize - Create a name from a
usize - name_
pair - Create one name from two (binary name composition)
- name_
unit - Create a name from unit, that is, create a “leaf” name.
- ns
- Creates or re-enters a given namespace; performs the given computation there.
- put
- Creates an unnamed, immutable reference cell (an eager
Art<_>) whose content may not change over time. - set
- Mutates a mutable articulation.
- structural
- Enters a special “namespace” where all name uses are ignored; instead, Adapton uses structural identity.
- thunk
- Allocates a thunk, an
Art<T>that consists of a suspended computation that produces a value of typeT. - thunk_
map - Map a given
thunkby a mapping functionmap_fn, yielding a new thunk.