4 ms·
> In most cases, Rust's very strong type system means you spend a lot less time actually running your program. That just sounds wrong to me TBH. IME it never p
by flohofwoe 3y ago
> In most cases, Rust's very strong type system means you spend a lot less time actually running your program.
That just sounds wrong to me TBH. IME it never pays off to 'front-load' too much, you might get a working implementation of your original idea without ever running the code, but that original idea will almost certainly be "wrong" once you see it in action and you just wasted a lot of time agonizing over your type structure which turned out to implement a quickly outdated idea.
Nothing beats quick iteration on a running program when it comes to productivity.
> Because Rust's unit of compilation (a crate) is very large. In C/C++ it's a single file.
If the a C++ file includes any C++ stdlib header it will also also become very large (tens of thousands of lines of gnarly template code for common headers like <vector> or <string>). If the unit of compilation is a crate in Rust it should actually be faster to build than typical C++ projects which often put the implementation for one class into one source file (and each of those source files is expanded to tens of thousands of lines of code after includes are resolved).
C mostly doesn't suffer from this problem though, since C header typically are only a couple dozen or hundred lines of API declarations.
- ladyanita22 3y ago> If the a C++ file includes any C++ stdlib header it will also also become very large (tens of thousands of lines of gnarly template code for common headers like <vector> or <string>). If the unit of compilation is a crate in Rust it should actually be faster to build than typical C++ projects which often put the implementation for one class into one source file (and each of those source files is expanded to tens of thousands of lines of code after includes are resolved). > C mostly doesn't suffer from this problem though, since C header typically are only a couple dozen or hundred lines of API declarations. But then, there's no reason why Rust couldn't be like C. The issue comes from the dependencies and libraries bundled, which is not an issue per se of the language.
- earthling8118 3y agoThis sounds overblown to me, TBH. IME you hardly need to agonize over type structure for common day to day code. The benefits of the type system are highly advantageous to refactoring without causing breakage, so I become more nimble in getting towards the proper structure. This is precisely what allows me to iterate more quickly and is a benefit.
- pjmlp 3y agoI had lots of coffee pauses when doing builds back in 2000, where our C bindings for the Tcl based server, used as Apache and IIS modules, across Aix, HP-UX, Solaris, Windows 2000/NT, Red-Hat Linux would take one hour per platform on average.