Hacker News new | past | comments | ask | show | jobs | submit login

I've become a huge fan of M4. At work, we needed to create a container that would create templated configuration files based on environment variables. We were considering using Mustache or other existing template systems, but most of them are fairly closely coupled to a programming language. We didn't want to tie container creation to a language runtime, and M4 seemed to be the most mature, well-documented (albeit crusty) language agnostic macro system.

M4 was easy to use, and unless you do something crazy, fairly easy to read. I ended up moving most of the actual envar reading/processing logic to a single base m4 file, and so the actual templates would import all necessary variables from the base m4 file and largely keep the original structure.

I wish there was a more "modern" (read: ergonomic) descendant of M4, but M4 is easy enough to understand, flexible, and extensively (if not well) documented enough that it's easy to use, stable, and fast enough for most of my use cases.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: