What I am trying to communicate / establish is simply like that, a method, a syntax if you like, of structuring an xmlesque sting of characters such that encapsulated within it is a structure which neatly sits the results of various computations together into an output when computed using the simple rules.
That sounds like Scheme, or any system with a tree-based representation of computations and encoding expression evaluation order. The correspondence between XML and S-expressions is well understood.
The problem with textual representations of tree (well, in this case, graph) structures is balancing the cost of serialization and deserialization with the desire for programmer expressivity and maintainability—the same as with any other programming language.
I've written similar code myself. (I suspect a fair percentage of experienced Perl developers have written and discarded their own templating systems.) Performance problems tend to come from not lexing and parsing templates into the appropriate graph structures and instead relying on greedy regular expressions to perform textual substitutions. Your big-O performance is probably abysmal based on the size of the template.
|