liquid-rust
liquid-rust copied to clipboard
Can a byte code work and would it be better?
Right now, the parser generates Box<Renderable>
s which are nested inside each other.
- Can't really gain much from CPU caches
- Heap fragmentation from all of these
What if we created a byte code?
- jumps
- request a label. At end of parse, the label gets resolved to an index
- prints
- support redirection for
capture
- support redirection for
- include is a "local function call"
- filters are "foreign function calls" and still box
- boxed functions for initalizing variables like those created for for loops
Would this actually be better? Can we actually represent all liquid logic this way?