"No race conditions, leaking resources, dangling pointers, unhandled exceptions, ..., the list goes on." Except of dangling pointers, Rust has everything else from this list. About compilation time issue: it doesn't exist anymore. Current versions do "cargo check" in a few seconds even for big projects (my biggest project is 45k LoC) and it takes a couple of minutes to compile it because of incremental compilation. F…
Still in love with Rust
21–30 of 186 posts
Re: Still in love with Rust
#22"No race conditions, leaking resources, dangling pointers, unhandled exceptions, ..., the list goes on." Except of dangling pointers, Rust has everything else from this list. About compilation time issue: it doesn't exist anymore. Current versions do "cargo check" in a few seconds even for big projects (my biggest project is 45k LoC) and it takes a couple of minutes to compile it because of incremental compilation. F…
I don't think 45k LoC could be considered big, and I _do_ think a couple minutes compile time is a problem. I say that as a C++ programmer, a full recompile will easily get me out of the zone
Re: Still in love with Rust
#23If you write the Fibonacci generator in one of the first chapters of the Rust book it will create a 4MB binary. Even stripped it's over 400KB.
If you write the same code in Nim it compiles down to 112KB with debug symbols, unstripped. Statically linked against libc (still with debug symbols) it's only 850KB.
850KB statically linked versus ~450KB dynamically linked and stripped.
For code that is virtually identical.
Re: Still in love with Rust
#24I think most of these programmers, and their project are not the target of Rust? If you're writing Java/C# or higher level languages, you already made the choice to sacrifice some computing efficiency for programming efficiency.
I always thought Rust was more destined to convert C and C++ (and D/Swift/Go ?) programmers, that need the raw power and control.
Re: Still in love with Rust
#25- non-type and template template parameters
- constexpr functions
I understand that Rust macros can replace them some of the time, and they are much better then the C preprocessor, but that's quite a low bar to meet. Last time I checked non-type template parameters (called "const generics" in Rust) is on the roadmap, so it is promising.
Re: Still in love with Rust
#26Thank you for this piece. I am working on a game, that I am prototyping in Go. In my prototype, I have just entered the realm of multiple threads, and for this project to work out, it needs to handle quite a lot of threads working on the same resources. While I have not personally dappled this far into concurrency in Go myself, I have read plenty of articles where developers recommend using the mutex package rather t…
Re: Still in love with Rust
#27"No race conditions, leaking resources, dangling pointers, unhandled exceptions, ..., the list goes on." Except of dangling pointers, Rust has everything else from this list. About compilation time issue: it doesn't exist anymore. Current versions do "cargo check" in a few seconds even for big projects (my biggest project is 45k LoC) and it takes a couple of minutes to compile it because of incremental compilation. F…
It is indeed true that you can unintentionally leak resources, but it is still much harder. Also, what do you mean that it has unhandled exceptions and race conditions? Rust doesn't even have exceptions (although there are panics, which is not the same thing), and race conditions are statically prevented in safe code due to how a mutable reference works.
About race conditions: https://doc.rust-lang.org/nomicon/races.html
Re: Still in love with Rust
#28"No race conditions, leaking resources, dangling pointers, unhandled exceptions, ..., the list goes on." Except of dangling pointers, Rust has everything else from this list. About compilation time issue: it doesn't exist anymore. Current versions do "cargo check" in a few seconds even for big projects (my biggest project is 45k LoC) and it takes a couple of minutes to compile it because of incremental compilation. F…
>big projects (my biggest project is 45k LoC) and it takes a couple of minutes to compile it I don't think 45k LoC could be considered big, and I _do_ think a couple minutes compile time is a problem. I say that as a C++ programmer, a full recompile will easily get me out of the zone
Re: Still in love with Rust
#29I tried Rust a few weeks ago. Is my understanding correct that Rust doesn't have the equivalents to the following C++ features yet? - non-type and template template parameters - constexpr functions I understand that Rust macros can replace them some of the time, and they are much better then the C preprocessor, but that's quite a low bar to meet. Last time I checked non-type template parameters (called "const generic…
Re: Still in love with Rust
#30Earlier quoted context omitted.
>big projects (my biggest project is 45k LoC) and it takes a couple of minutes to compile it I don't think 45k LoC could be considered big, and I _do_ think a couple minutes compile time is a problem. I say that as a C++ programmer, a full recompile will easily get me out of the zone
Out of curiosity, not to argue: how much time it takes in C++ to compile 45k LoC?