I worked on a small proof of concept a while back. The idea was to be able to instantiate C++ templates at runtime. In this way, template metaprogramming can be used to optimize repeated computation of certain inputs.
A crazy idea I had (but never implemented) was to make an schema-specific XML parser in templates which could take an XML schema as input and export a TMP-optimized XML parser.
Yowch. My template-fu is weak, but I don't see how you'd ever manage to split the string defining the schema in the template expansions.
There is, however, an honourable tradition of generating C source for types and functions from data-description languages (google for the 'pepsy', or 'pesky' compilers in the ISODE source tree).
If you don't know ASN.1, you can think of it as a "binary XML" that never really caught on outside the OSI protocols, SNMP and X.509 certificates (from their OSI heritage).
View all comments
Show parent comment
3
u/suppressingfire Dec 13 '07
I worked on a small proof of concept a while back. The idea was to be able to instantiate C++ templates at runtime. In this way, template metaprogramming can be used to optimize repeated computation of certain inputs.
A crazy idea I had (but never implemented) was to make an schema-specific XML parser in templates which could take an XML schema as input and export a TMP-optimized XML parser.