Using the C preprocessor as an HTML templating engine
31–34 of 34 posts
[flagged]
Re: Using the C preprocessor as an HTML templating engine
#32Seems like a bad idea, given that the CPP and HTML have a fair number of overlapping tokens (e.g. `#` for both URL fragments and macro beginnings). Why not use SSI[1]? It's inspired by the CPP's syntax, but is supported directly by most HTTP servers (and is more powerful, to boot). [1]: https://en.wikipedia.org/wiki/Server_Side_Includes
Completely forgot about SSI! What a cool feature
Re: Using the C preprocessor as an HTML templating engine
#33IIRC the earliest version of the C++ language, before a C++ compiler existed, was implemented with C and the M4 preprocessor. https://en.wikipedia.org/wiki/M4_(computer_language) https://www.gnu.org/software/m4/
Yep, it was called cfront. https://en.wikipedia.org/wiki/Cfront
cfront was a C++ => C transpiler
Re: Using the C preprocessor as an HTML templating engine
#34I do this for some very small static sites like: [0] [0] http://rbl.oc9.org/
Very cool, I like the simple mark up.