Skip to content

Can a byte code work and would it be better? #312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
epage opened this issue Dec 27, 2018 · 0 comments
Open

Can a byte code work and would it be better? #312

epage opened this issue Dec 27, 2018 · 0 comments

Comments

@epage
Copy link
Member

epage commented Dec 27, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant