4 ms·
M4 is an interesting macro language, but developed (IMO) a somewhat undeserved reputation for being awful because it is how you build autoconf inputs as well as
by fusiongyro 8y ago
M4 is an interesting macro language, but developed (IMO) a somewhat undeserved reputation for being awful because it is how you build autoconf inputs as well as sendmail configuration files. Guilt by association.
M4 has some "interesting" quirks but I have used it to build a static site. I briefly was maintaining my blog using make and M4. I no longer remember what the precise reason was that I stopped doing that, probably just that I wanted a through-the-web editor for content. I could dig up the "code" if there were interest in that.
- chris_wot 8y agoYou should definitely put that in GitHub or the like :-)
- totalperspectiv 8y agoI would also love to see that!
- gizmo686 8y agoMy experience with M4 is using it to write SELinux policy. The reference policy (which serves as a baseline to build build custom policy on top of) is essentially a DSL implemented with M4. Its actually a good language, and looks a lot like how we would have designed it if we were actually going to write it properly [0]. However, debugging it when something goes wrong (eg, what should be a syntax error) is atrocious. I'm sure it is great if you stick to using it for macros. However, at this point, I view it in the same light as Microsoft Excel: good at what it does, but too powerful for its own good. If your not careful, it will grow until you wish you had been using a proper programming language from the begging. [0] Except for the backtick as opening quote. Objectively, I think this is a good design decision for any language, but it takes a lot of getting used to.
- lolikoisuru 8y ago>[0] Except for the backtick as opening quote. Objectively, I think this is a good design decision for any language, but it takes a lot of getting used to. The `quoting' in m4 is pretty nice since it makes the quotes easy to nest. Sure braces would also be an option but I don't see any fundamental difference between the two, just visual.
- lolikoisuru 8y ago> I briefly was maintaining my blog using make and M4. I also wrote a static blog generator with M4 and GNU Make recently. It was the second time I've used M4 and it was pretty great. The first was a templating (probably missusing the term) system for my dotfiles to make them work across many distros and machines I have.
- wott 8y ago> M4 is an interesting macro language, but developed (IMO) a somewhat undeserved reputation for being awful because it is how you build autoconf inputs as well as sendmail configuration files. Guilt by association. Hmm...well, I remember my first Linux experience (1995): I rather messed with straight sendmail.cf than struggled with the M4 scripts which generated it. I never got those damn M4 scripts to do what I wanted. I guess M4 and I are incompatible.
- keithpeter 8y agohttps://datagrok.github.io/makebakery/ https://datagrok.github.io/makebakery/ I'm quite interested in using a directory tree of markdown files to generate a web site so that the directory names become index files showing lists of titles contained within the markdown files &c Looks like make (possibly with m4 macros) could provide that
- tinus_hn 8y agoM4 used to be the easy way to manage Sendmail configuration.