3 ms·
> Rust is a much more complex language than C Feature wise, yes. C forces you to keep a lot of irreducible complexity in your head. > Rust has a much, much sl
by Ygg2 2y ago
> Rust is a much more complex language than C
Feature wise, yes. C forces you to keep a lot of irreducible complexity in your head.
> Rust has a much, much slower compiler than pretty much any language out there
True. But it doesn't matter much in my opinion. A decent PC should be able to grind any Rust project in few seconds.
> Rust applications are sometimes
Sometimes is a weasel word. C is sometimes slower than Java.
> Rust takes most people far longer to "feel" productive
C takes me more time to feel productive. I have to write code, then unit test, then property tests, then run valgrind, check ubsan is on. Make more tests. Do property testing, then fuzz testing.
Or I can write same stuff in Rust and run tests. Run miri and bigger test suite if I'm using unsafe. Maybe fuzz test.
- TingPing 2y agoReal projects get into the millions of lines of code, Rust will not scale to compile that quickly.
- IshKebab 2y agoNot quickly, no. But neither does C++ (how long does it take to compile Clang?) and people manage fine. Faster would obviously be better, but it's not big enough of a deal to cancel out all the advantages compared to C.
- imtringued 2y agoI remember a project that used boost for very few things, but it included a single boost header in almost every file. That one boost header absolutely inflated the build times to insane levels.
- accelbred 2y agoI once moved a C++ project to C, and compile times went from 15 minutes to 5 seconds. It was a huge productivity boost. LLVM being slow to compile is also one of the reasons the Zig folk are looking to make it an optional dependency.
- thih9 2y agoGood for you. Like the grandparent commenter said, for others these tradeoffs might be important. E.g.: > I am disappointed with how poorly Rust's build scales, even with the incremental test-utf-8 benchmark which shouldn't be affected that much by adding unrelated files. (...) > I decided to not port the rest of quick-lint-js to Rust. But... if build times improve significantly, I will change my mind! https://quick-lint-js.com/blog/cpp-vs-rust-build-times/ https://quick-lint-js.com/blog/cpp-vs-rust-build-times/
- Ygg2 2y ago> Good for you. > https://quick-lint-js.com/blog/cpp-vs-rust-build-times/ https://quick-lint-js.com/blog/cpp-vs-rust-build-times/ Look you're picking a memory unsafe language versus a safe one. Whatever meager gains you save on compilation times (and the link shows the difference is meager if you aren't on a MacOS, which I'm not) will be obliterated by losses in figuring out which UB nasal demon was accidentally released. This is like that argument that dynamic types save time, because you can catch error in tests. But then have to write more tests to compensate, so you lose time overall.
- __d 2y ago> C takes me more time to feel productive. I have to write code, then unit test, then property tests, then run valgrind, check ubsan is on. Make more tests. Do property testing, then fuzz testing. So … make && make check ?
- tcfhgj 2y ago"How to install and use "make" in Windows?" https://stackoverflow.com/questions/32127524/how-to-install-and-use-make-in-windows https://stackoverflow.com/questions/32127524/how-to-install-...
- __d 2y agoIf you can figure out installing a C compiler, surely you can figure out installing make?
- kelnos 2y ago> A decent PC should be able to grind any Rust project in few seconds. That is demonstrably false, unless your definition of "decent PC" is something that costs $4000. I love Rust, but saying misleading (at best) things about build times is not a way to evangelize.
- Ygg2 2y ago> That is demonstrably false, unless your definition of "decent PC" is something that costs $4000. How is it demonstrably false? I'm on 5900x and Rust compilation speed was never an issue for me. More like $1500. $500 for 9950x. $200 for Mobo, $200 for memory and $100 for 1Tb ssd and power supply for $100. Coolers and case by desire. GPU optional. Only way to get to $4000 in a PC is you are buying fancy components or you bought latest xx90 card.
- anymouse123456 2y agoThis is a fair response! Thank you. We can disagree on these things and I'd still gladly buy you a beer.
- uecker 2y agoI don't feel like I need to keep a lot of complexity in my head for C. But one needs to have a concept of how to organize things. I guess Rust forces this onto you.
- astrange 2y ago> C takes me more time to feel productive. I have to write code, then unit test, then property tests, then run valgrind, check ubsan is on. Make more tests. Do property testing, then fuzz testing. Have you tried looking around and noticing nobody else does that and it's, like, fine?