Module adapton::engine
[−]
[src]
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.
To program algorithms that use this interface, consider the following functions and macros:
fn force
, which observes/consumes/demands the value of anArt
.fn cell
, which allocates/produces anArt
to hold a given value. See also, the macrocell_call!
, which places the result of a function call into a (named) cell.fn thunk
, and the macrosthunk!
andeager!
, which introduceArt
s that hold suspended computations and produce their results, whenforce
d. The macroeager!
forces this suspended computation eagerly.fn ns
, which manages a monadic naming policy for allocations bycell
andthunk
(and macros that use these). This function extends the current path (a sequence of names) by one name, which we refer to as a namespace. This namespace concept is analogous to a directory in the UNIX filesystem.
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
|
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
|
Enums
ArtIdChoice |
An |
Engine |
The engine API works in two modes: |
Functions
cell |
Creates a named reference cell (an eager |
force |
Demands and observes the value of an |
force_map |
Demands and observes the value of an |
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 |
name_of_str |
Create a name from a |
name_of_string |
Create a name from a |
name_of_usize |
Create a name from a |
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 |
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 |