Skip to content
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

Reimagine imports/includes without generating new code #71

Open
schveiguy opened this issue Oct 11, 2019 · 0 comments
Open

Reimagine imports/includes without generating new code #71

schveiguy opened this issue Oct 11, 2019 · 0 comments

Comments

@schveiguy
Copy link
Contributor

schveiguy commented Oct 11, 2019

An import or extend treats the file as if it were all the same (Right?) file in terms of generating the AST from the parsed file. In essence, including a file inside a diet template is like you included it in that spot.

However, the engine doesn't really need to reparse these files does it? In fact, it would be nice if it doesn't even need to regenerate the code. I'm imagining that each code might have its own "template" that can be called directly from an including template, just like D modules call other D modules. The savings might be huge. In my project, every single diet template is an extension of a layout template. Imagine if that layout template doesn't even need to be parsed and transpiled every single time it's used.

I'm getting very close to the limit of where my project can be built, and I'm trying to imagine ways I can save on compile time memory usage. This might be one of them. I don't have a concrete plan for how this can happen, but it definitely would be useful to explore these areas.

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