Videos
Up untill know, I've coded mostly in Java and Python. However, I work on mathematical stuff - data science/MILP optimizations/... which needs to be performant. This is taken care of for me by libraries and solvers, but I'd like to learn to write performant code anyway.
Thus, I'd like to learn Rust or C++ and I plan implementing algorithms like simplex method, differential equation solvers, etc.
From what I read, Rust sounds like it would be more fun than C++, which is important to me. On the other hand, most of the solvers/libraries I use are written in C/C++, so knowing that language could be a huge plus.
So my question is - if I learn and use Rust for these personal projects, how hard would it be to switch to C/C++ if such need arises in my work?
Hello all, I’m putting this question in this thread purposely because I really want to hear from experienced Rust programmers (whether they be professional or unpaid proficient users of Rust) when they think C is actually a better language choice for a given project.
Based on your experience with Rust, what project types would you still elect to write in C?
Talking purely about performance, not development or compile time.
Also, I understand they would be lower level projects, but I am more curious about actual specific things you would build in C over Rust.
This question has likely been asked before in some form; but I would like to hear from people who know Rust better than me, what makes programming in Rust better than programming in C and C++? And when I say Rust, I don't mean just the language or the compiler, I mean the entire development "environment" including Cargo, Clippy, etc. tooling. Even more specifically, what are specific innovations that Rust might present in the following areas compared to C and C++ development.
-
Macros
-
Errors, error-handling
-
External functions
-
Constants
-
Passing data to a function
I often hear people talk about things that Rust simply encourages, such as zero-cost abstractions and zero-copy operations. There isn't anything about C or C++ that directly prevents zero-cost abstractions - right? I would like to know what are very concrete things that Rust does that C or C++ fundamentally cannot do in relation to the things I listed above.
Edit:
Here are some things that I suspect might be improvements but I might be completely wrong so please let me know
-
Macros are expanded in a different way
-
Errors in macro parsing are handled better
-
Errors in macro after expansion are handled better
-
Errors can be reported to a user of a library better
-
Some errors in calling external functions can be reported at compile time
-
Some kinds of constants are supported in Rust but not in C or C++
-
When data is passed to a function, there are static guarantees provided
Are any of these sort-of true?
Edit:
By the way, I'm not asking this for myself. This is more of a "survey".