Files
@ 3ffeb97c88a7
Branch filter:
Location: CSY/reowolf/src/protocol/eval/mod.rs - annotation
3ffeb97c88a7
1.3 KiB
application/rls-services+xml
Add docs for implementing infinite types in a value based language.
Since we are a value based language and do not have the concept of
pointers, then if we want to lay out the memory of datatypes we run
into a problem when the types represent recursive datastructures:
these are infinite in size. So we have an algorithm for turning
some types into pointer-like things, such that we can lay everything
out in memory.
Since we are a value based language and do not have the concept of
pointers, then if we want to lay out the memory of datatypes we run
into a problem when the types represent recursive datastructures:
these are infinite in size. So we have an algorithm for turning
some types into pointer-like things, such that we can lay everything
out in memory.
6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 6810fd00a570 3845071002b0 6810fd00a570 6810fd00a570 6810fd00a570 d36ad4f5458b d36ad4f5458b d36ad4f5458b b69f417a9972 6810fd00a570 b69f417a9972 3845071002b0 9b32fa307ceb 3845071002b0 6810fd00a570 | /// eval
///
/// Evaluator of the generated AST. Note that we use some misappropriated terms
/// to describe where values live and what they do. This is a temporary
/// implementation of an evaluator until some kind of appropriate bytecode or
/// machine code is generated.
///
/// Code is always executed within a "frame". For Reowolf the first frame is
/// usually an executed component. All subsequent frames are function calls.
/// Simple values live on the "stack". Each variable/parameter has a place on
/// the stack where its values are stored. If the value is not a primitive, then
/// its value will be stored in the "heap". Expressions are treated differently
/// and use a separate "stack" for their evaluation.
///
/// Since this is a value-based language, most values are copied. One has to be
/// careful with values that reside in the "heap" and make sure that copies are
/// properly removed from the heap..
///
/// Just to reiterate: this is a temporary wasteful implementation. A proper
/// implementation would fully fill out the type table with alignment/size/
/// offset information and lay out bytecode.
pub(crate) mod value;
pub(crate) mod store;
pub(crate) mod executor;
pub(crate) mod error;
pub use error::EvalError;
pub use value::{Value, ValueGroup};
pub(crate) use store::{Store};
pub use executor::{EvalContinuation, Prompt};
|