Remix.run Logo
layla5alive 6 days ago

Clearly this is generated code. I have mixed feelings about this. On the one hand, I'm glad its a single file, as its faster to parse than if it'd been split up among a whole bunch of smaller files. And that it isn't generated during the build is a complexity advantage, even if it is huge. OTOH, no human is going to read this whole file, so I wonder if there was not a better way.

burnt-resistor 5 days ago | parent [-]

All other things being equal, I'd rather have a codegen step added to the build process for mechanical, non-human-maintained code rather than foist mega files on everyone if those were the only two choices.

beeflet 5 days ago | parent | next [-]

I suppose it depends on the portability of the mega-files. It could be an output from a complex non-portable program.

burnt-resistor 5 days ago | parent [-]

Don't make or allow complex, non-portable programs. There's no reason for this. Simplicity and Turing completeness means it can always be written in something understandable and maintainable.

lunar-whitey 5 days ago | parent [-]

Simple portable programs that perform nontrivial tasks are expensive. Open source overcomes this where possible by socializing the cost.

emchammer 5 days ago | parent [-]

I use open-source OpenBSD is because the entire source tree is small enough for me to understand and manipulate. I guess I expect that it is all human-generated. This unwieldy, proprietary chunk makes me want to ditch graphics support in order to keep my source tree significantly smaller.

lunar-whitey 5 days ago | parent [-]

After cleaning up the sources, the whole chip would still be an unwieldy proprietary chunk - you would just be able to ignore it more easily.

cnst 5 days ago | parent | prev [-]

If you look at the history of these files, they've basically changed at most once after being committed years ago.

Regenerating such static data from some master source, would be completely pointless, and would add pointless extra dependencies to the build process, and in this specific case, may likely not even be possible because of the proprietary nature of the off-topic tooling that may be required for effective management of the initial files.

---

In OpenBSD, NetBSD and other systems, there's actually a whole bunch of machine-generated files that are always part of the repository.

Things like build manifests (lists of all the binary files in the shipping product, e.g., distrib/sets/lists/base/mi) and pcidevs/usbdevs, are things that immediately come to mind:

https://github.com/search?q=repo%3Aopenbsd%2Fsrc+sync&type=c...

https://github.com/search?q=repo%3Aopenbsd%2Fsrc+regen&type=...

Avoiding bison/yacc parser generators as a build dependency, is another common case for the practice.

Personally, I'm a huge proponent of the practice. It allows you to reduce the complexity of the build system, increase the transparency on the history of the changes, and allows people to have a better understanding of where things are coming from, because you can directly find those things in the respective pcidevs.h / usbdevs.h, instead of wondering what is going on, and where those things are defined. It's a HUGE advantage.

I never understood why so many people are horrified at the idea of small amounts of the machine-generated code being manually committed straight into the repositories. It seems like they're incorrectly applying the general rule against such practice, ignoring the specific exceptions that are certainly most beneficial under the circumstances.

One of my favourite other examples is the self-documenting code. E.g., man-pages or test results. For example, maybe you use Go, and your man-pages are automatically generated based on the inline documentation within each go file itself. Committing such human-readable artefacts into the repository is a great idea if that allows everyone to immediately see what's going on with regards to the documentation, instead of having to run the code to see how it works. This increases transparency and code review efficiency, make it easier to promote the changes, because it's very clear to everyone what's going on, without having to reverse-engineer the code, or apply the patches and recompile etc.

Of course, if your whole idea is to hide things from management, and increase the complexity of the system to prevent the newcomers from catching up quickly, then such practices may indeed be detrimental.

Y_Y 5 days ago | parent [-]

> I never understood why so many people are horrified at the idea of small amounts of the machine-generated code being manually committed straight into the repositories.

If you haven't understood maybe you could think more about it, or ask, or reduce the hyperbole until you're looking at something reasonable.

The anount of code were talking about here is by no measure small, nor is it "horrifying" people. Your post reads like the kind of weird advocacy that shows up in Jira pissing matches.

cnst 4 days ago | parent [-]

I'm not talking about this specific AMD DRM code that's taking over the entire tree, I'm talking about the specific other examples that I've outlined in my prior message.

Instead of violating the HN guidelines by assuming malice and portraying me as never having bothered to think about the issue, why don't you educate all of us why exactly is it a problem to have the build lists and usbdevs/pcidevs artefacts be part of the repos of reputable open-source projects like OpenBSD / NetBSD? Specifically, addressing the lack of benefits that I've identified as existing in the status quo?

Because all these other people who have an issue with such practice, never bother to provide any convincing arguments why the rule should never be violated, either, and how the benefits that I've identified, aren't worth the hassle. They literally just don't even listen why we're doing it, and they never provide alternatives that fit the requirements and don't require lots of extra worse or hassle. And they're not even doing OSS, either, so, it's not like their code quality is even better in any way, because it's well known that the quality of the closed-source software is often far worse than OSS, especially when we're talking about OpenBSD here.