Should Rust have something like go generate?
So Go has a command go generate, which can be used to execute code generation (or other) commands defined directly in Go source code (a special comment). Generally, it is executed before committing that generated code to the repo.
For example, it can be used with sqlc to generate database related stuff from plain sql queries.
I have my gripes with this approach and Rust generally uses proc macros to achieve the same goals. However, I think Go's approach has one specific advantage in the case of library code. It is much easier to read code, which is already the result of go generate, compared to Rust's invocations of proc macros.
For example, embedded HAL crates often use macros to generate boilerplate for every gpio pin. As a user, this is hard to read. You basically have to read the macro source code and figure out in your head what code that actually generates. Maybe you could do cargo expand, but I don't even know how to do that for libraries. That seems like an unergonomic solution.
What if library authors could choose to execute their macros before publishing to crates.io? That would fix the problem described and in some cases even reduce compile time for downstream users, right?
What do you think? Is this useless, difficult to implement or would it cause some other problem I haven't thought about?