Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I would go even further: showing the generated cmake file is like showing the disassembly from the zig snippet shown.

I still think the point stands though: zig's build system is nicer. Still bad IMHO as I despise build systems where you describe the build in the same language. Most of the time, it's much better to have a declarative rather than imperative build system. All in all, Ninja/Meson/Cargo/etc are much better in this regard.

(and yes, I think build.rs was a mistake, a necessary evil. Definitely not a feature)



I have never once had to make a build.rs file, except to make python bindings for some of my own rust libraries. Are people out here using build.rs for everyday driving?


Bindings, and generally any form of code generation, is the most common form of build.rs I see in the wild.

One such example of "daily driving" is for gRPC, where the canonical way to generate the protobuf and gRPC bindings using Tonic+Prost is through build.rs. Another is C-to-Rust bindings, for all of those -sys crates.

Though I've also seen it used to circumvent limitations of Cargo, e.g. for invocations of dependent cargo build steps, etc. Overall, it's less common (or more robust?) than it used to be 5-ish years ago.


I would love it if we introduced specialized means of addressing each of these use cases, to make them declarative.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: