3 ms·
Because the generated C is expected to be integrated into the project as source code: "Along the way, we learned what it takes to deliver quality C code that ca
by scott_s 8y ago
Because the generated C is expected to be integrated into the project as source code: "Along the way, we learned what it takes to deliver quality C code that can be taken seriously and integrated into an actual source tree."
The code they generate is supposed to live on as source code, along with other code in the project. We should expect people to read and try to reason about code that exists in source control.
- cryptonector 8y agoFor code generators whose output you must or are expected to tinker with, I completely agree. For compilers, however, I do not. For example, one codebase I help maintain is Heimdal, and it has its own ASN.1 compiler that generates C (and also something of an interpreted bytecode, as an option), and it's output is not even properly indented -- nobody minds because it works, and on the rare occasion I have to inspect that code, I use tools like VIM or clang to format it.
- abainbridge 8y agoIt isn't just tinkering that means the C must be readable. People need to be able to read it and understand what it does without learning F*.