Notes
Current Object type definition
Will try to keep this updated as currently there’s a lot of placeholders:
pub enum Object {
Void,
Keyword(String),
BinaryOp(String),
Integer(i64),
Float(f64),
Bool(bool),
String(String),
Symbol(String),
ListData(Vec<Object>),
Lambda(Vec<String>, Rc<Vec<Object>>, Rc<RefCell<Env>>),
List(Rc<Vec<Object>>),
Now, //value that get's replaced with the current instant when it is eval'd
Instant(std::time::Instant), //timestamp
Duration(std::time::Duration),
// relative dimensions get replaced with absolute positions
// when evaluated in environments with absolute parent dimensions
// top level view evals always have absolute sizes which "trickle down"
ParentWidth(f64),
ParentHeight(f64),
ViewWidth(f64),
ViewHeight(f64),
Shape(i64), //placeholder
Color(DynamicColor),
Brush(i64), //placeholder
Draw(Draw), //drawop is a (brush, shape) tuple
Text(i64), //placeholder
Image(peniko::Image), //placeholder
// no real clue yet how I want to deal with these
Texture(i64),
Shader(i64),
Pipeline,
}
Actor and process overview of current wayland actor implementation:
Two Syndicate actors, A and B, make assertions into a Klee dataspace, DS_k. Klee actor, K is also connected to the dataspace, and has a linked task, K_L running, which forks off a separate thread K_i, which runs the wayland client and klee interpreter.
Journey of an assertion from a drawing actor to the screen:
- Assertion is made by actor A
- The assertion is either a
definition
of a symbol -> expression, aview
expression, ordata
which is anything else.This is an important nuance of the klee system, you cannot for example send the expressionEDIT: This has been updated.(+ 1 2)
to the dataspace and expect for the system to assert a response, the only expression which is ever evaluated at the top level is theview
expression - Process assertion:
- If the assertion is a
definition
, this message is forwarded to the Klee actor, which lightly processes the definition, then forwards it over a rust channel to the thread running the actual Klee interpreter wayland client. Once in the klee interpreter the message is parsed and the interpreter’s environment is updated before nextview
execution. - If the assertion is a
view
this is very similar todefinition
, except it is theview
function which is updated in the environment. - If it is
data
, the same original path is taken to the interpreter, but then once at the interpreter it parses the data and tries to find any matching observations of this data pattern. If it does it updates all matches and executes any sub-trees that need updating.
- If the assertion is a