liquid-rust icon indicating copy to clipboard operation
liquid-rust copied to clipboard

Can a byte code work and would it be better?

Open epage opened this issue 6 years ago • 0 comments

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
  • 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?

epage avatar Dec 27 '18 01:12 epage