Skip to content

Reimagine imports/includes without generating new code #71

@schveiguy

Description

@schveiguy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions