Live data from Hacker News

Using the C preprocessor as an HTML templating engine

github.com

31–34 of 34 posts

Re: Using the C preprocessor as an HTML templating engine

#32

Seems 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

#33
post #17
post #6

IIRC 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
Post reply on HN