4 ms·
Tooling is but one reason I hope Rust eats C/C++ lunch. I think everyone has some story of banging their head against an asinine build process. I am certainly s
by 0cf8612b2e1e 3y ago
Tooling is but one reason I hope Rust eats C/C++ lunch. I think everyone has some story of banging their head against an asinine build process. I am certainly sick of ./configure, make build, huge wait, and then a missing libXYZ error, install XYZ, repeat, missing libABC.
- FpUser 3y ago>" I think everyone has some story of banging their head against an asinine build process" Not my case. I have simple CMake files for my projects and have no problems building on Linux and Windows (I do not do Mac). I do use few libraries (Postgres, network - http/tcp/udp and some others). So far no troubles. I do remember it was way more complicated though. So I am not really missing "Rust eating C++'s lunch". I do understand there are some real life huge insanely complex projects with basillion options. Luckily I do not havbe to deal with that part.
- shric 3y agoCMake doesn't fetch your dependencies for you and ensure they're the version that your code is compatible with. I've cloned 5 year old C++ repos that use cmake and it's quite an effort to build them, mostly due to finding all the dependencies correctly versioed.
- FpUser 3y agoI do not want it to fetch dependencies. I download those once and include it as a copy per project. Update on on-need basis. Over the years I have accumulated enough. To start new project all I have to do is - clone template directory and I am ready to go.
- neeeeees 3y ago> CMake doesn't fetch your dependencies for you and ensure they're the version that your code is compatible with. That’s a little too harsh. You can certainly make it do that via a combination of git tags (to build from source) and CMake modules/Find*, but yes, it’s much more cumbersome than cargo/npm/go
- jahnu 3y agoThis is true for almost all projects but things are getting better. I use CPM for a couple of years now and get the experience desired https://github.com/cpm-cmake/CPM.cmake https://github.com/cpm-cmake/CPM.cmake
- WanderPanda 3y agoCalling CMake a build „system“ is an overstatement given how unsystematic it is (you have to memorize everything)
- nicup12345689 3y agoYou have chatGPT, come on
- cyber_kinetist 3y agoBut building something more complex in Rust (than just grabbing a bunch of libraries from Cargo) becomes as tedious as what you typically expect in C++ land. I've read anecdotes of Rust devs struggling with build.rs (the official build scripting in Rust) similarly to how people bang their heads at CMake. This is why other C++ build systems like Bazel and Meson added Rust support, since Cargo/build.rs itself isn't sufficient enough for all use cases (especially when using it alongside with other systems languages.) And it's not too wild for something to think of adding Rust support for CMake as well...
- steveklabnik 3y agoDon't forget Buck! Buck2 is implemented in Rust even.
- uxp8u61q 3y agoWhat do you do when your Rust project requires a dependency written in something other than Rust?
- steveklabnik 3y agoYou use a "build script" to hook into the compilation process and have it invoke the build of whatever it is you're trying to additionally build. And if it's not that big, say, a single C file, you can just invoke the C compiler. An example: https://crates.io/crates/cc https://crates.io/crates/cc
- mustache_kimono 3y agoSee: https://doc.rust-lang.org/cargo/reference/build-scripts.html https://doc.rust-lang.org/cargo/reference/build-scripts.html
- pjmlp 3y agoRust still doesn't have an IDE and graphical debugging story that can do half of the C and C++ development environments are capable of. The community hasn't standed still, conan and vcpkg + cmake are already quite good.