3 ms·
> But if you want to make even a single tiny modification to one of the generated files, you're busted, you need a different solution. Not totally true, if you
by pphysch 3y ago
> But if you want to make even a single tiny modification to one of the generated files, you're busted, you need a different solution.
Not totally true, if you can robustly express your tiny change as a `sed` or `awk` script, you can just append to the generator pipeline. Speaking from experience, do not condone, etc.
- dmoy 3y agoI think GP means "make a tiny change [after generation, outside of the generator, and persist that change independent of the generator code]", which is where all the demons are waiting Modifying the generator itself to do something different every time, and doing GP's stated "regenerate and throw away the old stuff" is in line
- pphysch 3y agoIt's not modifying the generator. The generator may be a proprietary black box. It's wrapping the generator in a bash script that pipes the result through AWK, etc.
- xamolxix 3y ago> It's wrapping the generator in a bash script that pipes the result through AWK, etc. Which is itself a generator
- dmoy 3y agoSure, that's orthogonal. If you wrap the generator in your build system and still always regenerate, it's effectively the same. And also, I think, not what GP was talking about
- pphysch 3y agoPedantic. There's a world of difference between grokking a new code generation DSL+codebase and a shell one-liner that fixes a string that is obviously invalid. Since the issue is the maintenance of such systems, it is absolutely relevant.
- sanderjd 3y agoAs other commenters have noted, if the awk script is just a pure function of the output of the black-box generator to a new output, then I would consider this a modification to the generator, and no problemo. However, if your awk script requires the current state of the generated code as input in addition to the output of the black-box generator, and tries to reconcile a diff between the two things, then yep, I consider that busted.
- sanderjd 3y agoNo thank you! I don't enjoy fighting dragons :)