notes/Projects/bachelor/RUNTIME_EXECUTOR.md

26 lines
1.3 KiB
Markdown
Raw Normal View History

2024-03-01 13:37:14 +01:00
# RUNTIME_EXECUTOR
This component receives a serialized node_graph and returns the output. I generally love the idea that a node is a pure function which just receives its own inputs and then calculates them. BUT! there is always a but, there are some things that the nodes needs that are not its own inputs. These are in my experience:
**run_seed**
Some nodes generate random values, and to generate random values we generally need a seed value.
**settings**
There are some values that are kind-of global inputs. That means they are inputs to the node, but each node receives the same input. For example for the plant nodes, they are the resolution of each leave.
After some thinking, my idea is to model these inputs as *hidden* inputs to the node. So they are not gonna be visible in the **NODE_INTERFACE**.
But they are gonna be passed to the nodes as normal inputs. This could be super useful to allow easy memoization of the nodes, because if none of the inputs changed, we can return the previously computed output.
## Linking/Importing of Nodes
**WebAssembly Components**
\- only works in wasmtime / jco at the moment
For this the runtime_executor needs to be wasm aswell.
**No linking**
\+ Very easy to implement, works everywhere
\- Probably not as fast as components