10. A system for generating a valid HTML document, comprising: a memory configured to store an abstract syntax tree, the abstract syntax tree including a plurality of nodes, each node in the plurality of nodes representing an element in a template file; an interpreter configured to: traverse the abstract syntax tree in response to receiving a request on a web server for a webpage; for each node in the abstract syntax tree: determining a type of the node; and perform an action based on the determined node type using one or more compiled template objects generated from one or more templates in the template file; generate the valid HTML document based on the plurality of actions determined by traversing the abstract syntax tree on the web server, to send to display the webpage on a browser, wherein the valid HTML document is type-defined.
11. The system of claim 10 , wherein the type of the node is an expression node and the interpreter is further configured to: insert a textual expression associated with the node into the valid HTML document.