Module fungi_lang::dynamics

source ·
Expand description

Syntax for dynamic, evaluation-time structures.

Notably, some of these syntantic forms are absent from programs written by the programmer; rather, they only arise dynamically, from running these programs, and in some cases, by using Adapton engine.

However, since they are common to multiple operational semantics (eval and reduce), we separate these dynamic structures from any one particular evaluation semantics.

For practical reasons, these AST structures still must be mentioned in the static structure. Namely, the Exp::HostEval form holds a function over these types, providing a “trapdoor” for libraries to extend the core evaluation rules below with custom ones (e.g., for standard library primitives, such as vectors). See also: The ExpTerm type.

Structs

Enums

TODO-Sometime: Prune the environments (using free variables as filters)
Terminal expressions (a la CBPV), but in environment-passing style, where (closed) lambda terms have closing environments.
Name Term Values. The value forms (name and lambda) for the Name Term sub-language (STLC + names).
Run-time values. Compare to ast::Val.

Functions

Given a closing environment and an ast value (with zero or more variables) producing a closed, run-time value.
See close_val
Name conversion. Convert an ast name into a run-time (adapton library) name.
Evaluate a name term, dynamically (see also: normal module)
Evaluate a name term, dynamically (see also: normal module)
Convert a name term value back into (the same) name term
Substitute a name term value for a free variable in another term
Substitute a name term value for a free variable in another term
project/pattern-match the name of namespace, defined as the sub-term M in the following nameterm (lambda) form:
Wrapper for Ret constructor.

Type Definitions

The Rust type of all Fungi references
Run-time values
The Rust type of all Fungi thunks