5 ms·
I actually looked into some of these frameworks (in particular mustache but also a few others) before deciding to use m4. They were all either too complex or to
by simias 6y ago
I actually looked into some of these frameworks (in particular mustache but also a few others) before deciding to use m4. They were all either too complex or too limited (sometimes both!) for my use case.
M4 is old and clunky but it gets the job done without having to install half a trillion Node.js dependencies. I also know that my script will still work just fine 5 years from now (or even 50 years in all likelihood).
That being said, don't trash your favourite JS framework right away, while m4 is perfectly fine for simple tasks I don't even want to imagine the layers of opaque and recursive macros you'd end up having to maintain for any moderately complex project. It's like shell scripts, it's very convenient but it doesn't really scale.
- bartread 6y ago> while m4 is perfectly fine for simple tasks I don't even want to imagine the layers of opaque and recursive macros you'd end up having to maintain for any moderately complex project I'm not doing anything too clever with Pug, but there are certainly a bunch of things that it makes quite easy that would otherwise be awkward or complex. Lots of things work really nicely as well: includes, sections, configuration, and it certainly cuts down on typing. I'm absolutely not contemplating a switch from Pug to M4. I just find it interesting that there's this thing that's been hanging around for decades that would do at least a partial job and is still decent for simpler use cases.
- cutler 6y agoHave a look at Perl's Template Toolkit. It used to be state-of-the-art for text and HTML templating.