forked from katzen-cafe/iowo
repo: rename executor -> eval
This commit is contained in:
parent
23fadce867
commit
c4207af8da
8 changed files with 3 additions and 3 deletions
34
crates/eval/src/lib.rs
Normal file
34
crates/eval/src/lib.rs
Normal file
|
@ -0,0 +1,34 @@
|
|||
use ir::instruction::Kind;
|
||||
use value::Dynamic;
|
||||
|
||||
mod debug;
|
||||
mod value;
|
||||
|
||||
/// The available executors
|
||||
/// unused in early dev.
|
||||
#[derive(Debug, Clone, Copy, clap::ValueEnum)]
|
||||
pub enum RegisteredExecutor {
|
||||
/// the debug executor is single threaded and really, *really* slow. And unstable. Don't use. Unless you're a dev working on this.
|
||||
Debug,
|
||||
}
|
||||
|
||||
trait Executor {
|
||||
fn execute(instruction: Kind, input: Option<Dynamic>) -> Option<Dynamic>;
|
||||
}
|
||||
|
||||
pub fn execute_all(instructions: Vec<Kind>) {
|
||||
let mut tmp = None;
|
||||
|
||||
for instruction in instructions {
|
||||
tmp = debug::Executor::execute(instruction, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
// scratchpad lol:
|
||||
// execution structure:
|
||||
// 1. take in rpl
|
||||
// 2. analyse/validate structure against allowed executors
|
||||
// 3. assign executors to instructions
|
||||
// 4. optimize
|
||||
// 5. prepare memory management patterns
|
||||
// 6. run
|
Loading…
Add table
Add a link
Reference in a new issue