-
Notifications
You must be signed in to change notification settings - Fork 7
Stages (design notes)
Currently (as of a596f322e5d1d088b4f36ec9ed9f90024a9ed252), a template is made of rules which are grounded against a source (the HTML file), after that the grounded rules are turned into a plan.
This works fine for static output. However in the context of dynamic templating, new hurdles are found or rather exacerbated: the set of ops (replace
, dup
, skip
and if
) is not well thought out and creates some cardinality explosion (well a small explosion, but a small explosion in a confined room: my bandwith).
I'm now thinking of adding a 3rd stage: grounding, planning and componentization. After componentization, there will be only replace ops left! All other logic will have mirated to the top of a component. So a dup
would be a replace
with some component and the component will perform the looping. Hence the cardinality problem moved out of the call sites: all call sites are now very regular.
The regularity of call sites is going to allow for some optimization like discarding the replaced nodes (pitfalls: shifting indices on the static side and text-nodes merging on the dynamic side).