News for hackers. Stuff that matters.
Re:Don't DRY Your Code Prematurely by emidln on Thursday May 30, 2024 @02:35PM (#40527180)
Bazel solves this exact problem (coming from its macrosystem) by allowing you to ask for what I term the "macroexpanded" BUILD definition using `bazel query --output=build //some/pkg/or:target`. When bazel does this, it also comments the file, macro,and line number the expanded content came from for each block.

This gives us reuse without obscuring the real definition.

I automated this in my emacs to be able to "macroexpand" the current buid file in a new buffer. It saves me a lot of time.

There are no comments on this comment yet.