News for hackers. Stuff that matters.
Re:M4 (computer language) by fusiongyro on Saturday August 18, 2018 @12:29AM (#17786872)
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.

Re:M4 (computer language) by gizmo686 on Saturday August 18, 2018 @01:58AM (#17787100)
My 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.

Re:M4 (computer language) by lolikoisuru on Saturday August 18, 2018 @04:34AM (#17787503)
>[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.

Re:M4 (computer language) by chris_wot on Saturday August 18, 2018 @12:34AM (#17786882)
You should definitely put that in GitHub or the like :-)
Re:M4 (computer language) by totalperspectiv on Saturday August 18, 2018 @12:47AM (#17786914)
I would also love to see that!
Re:M4 (computer language) by wott on Saturday August 18, 2018 @07:16AM (#17787984)
> 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.

Re:M4 (computer language) by keithpeter on Saturday August 18, 2018 @12:16PM (#17789152)
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

Re:M4 (computer language) by lolikoisuru on Saturday August 18, 2018 @04:27AM (#17787484)
> 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.

Re:M4 (computer language) by tinus_hn on Sunday August 19, 2018 @10:31AM (#17794445)
M4 used to be the easy way to manage Sendmail configuration.