Hacker News new | ask | show | jobs
by anon_d 5271 days ago
Yep. Why try to force a tool into a role it was never designed for? You use m4 or just write a preprocessor in any language. If you really want to do complicated lisp-style meta-programming stuff with C, just write another C program to pre-process your C program. It's more work, but it gives you complete control over the syntax.
1 comments

...or just use Python, Ruby, or Lisp directly?

Doing weird things to a C file (while occasionally useful) is just increasing the technical debt of your teammates later.

(though, we do have a closure-ish macro in our codebase that's pretty nifty, so do as I say not as I do etc.)

    >> If you really want to do complicated lisp-style meta-programming stuff
    > Increases technical debt
    Yep. The sane solution is to just not do stuff like this at all. In rare
    situations it ends up being worth it.