4 ms·
Compiling a Static Web Site Using the C Preprocessor
- YngwieMalware 11y agoNice piece of history. You can see its age showing: "Rather quickly it was realized that if you want to ensure a reasonable user experience both on desktops and mobiles, there is absolutely no way you can use the same HTML for both sites."
- m6w6 11y ago> In fact, almost any kind of text processor can be used to compile web sites in a similar way to what has been described above (for example, m4 ... I thought about m4 all the time while reading through that post...
- Esau 11y agoThe only time I ever used M4 was when trying to create a Sendmail configuration. I really disliked it.
- EvanPlaice 11y agoCongrats, you've re-discovered the same origin where PHP started nearly 20 years ago. Maybe you could replace the generic c preprocessor dialect with a new domain specific DSL. For instance one where macros can simply be embedded directly into HTML. For instance everything between the <? and ?> is parsed as macros. /s
- krapp 11y agoI wonder if one could propose that "any sufficiently complicated static website compiler contains an ad-hoc, informally specificed, bug ridden, slow implementation of half of PHP..."
- EvanPlaice 11y agoHaha, I never thought of it like that before. That probably holds true for any one written in C. Maybe even some others that use server-side view generation.