despite developers' positive feelings toward Rust, 97% of them hadn't actually used it.
Who says they love something they have not used???
I might say something seems decent, but no way would I say I *LOVE* a language until I've done a few real things in it.
The top issues that respondents say the Rust project could do to improve adoption of the language are better training and documentation, followed by better libraries, IDE integration, and improved compile times...
I don't see why anyone would "love" any programming language.
I have looked at Rust and written some simple toy programs. But I don't use it for work.
The problems Rust claims to fix, such as memory leaks, buffer overflows, and safe threads, can be done in C++ with "safe pointers", proper programming practices, and coding standards.
So, with a huge code base of working C++, it doesn't make sense to switch. It would be yet-another-language that everyone we hire would need to know. We would be constantly swit
The problems Rust claims to fix, such as memory leaks, buffer overflows, and safe threads, can be done in C++ with "safe pointers", proper programming practices, and coding standards.
How do you automate auditing a C++ project for use of the sort of "proper programming practices and coding standards" that prevent the same problems that safe Rust prevents?
by Anonymous Coward writes:
on Sunday April 26, 2020 @04:00PM (#59993580)
If you are using new (or god forbid malloc) instead of the STL containers and class members to allocate and delete objects, you are setting yourself up for failure.
So no shared_ptr for you? No objects with dynamic lifetime? Looks like you would enjoy using linear type system like Rust has.
shared_ptr requires you to use new or malloc? And what do you imagine by "dynamic lifetime"? Don't you mean indefinite lifetime? Since otherwise it doesn't make a lot of sense to me.
Dynamic lifetime - lifetime depending on program logic (not dependent on stack and not statically allocated). It is not infinite lifetime. You should de-allocate everything before exit. And objects with dynamic lifetime are de-allocated long time before exit most of the time.
You may not use new in your code when you use shared_ptr but it will be used in the library anyway (like e.g. in make_shared). shared_ptr does not avoid the really hard problem of memory management of C++ programs. It only makes it some
make_shared() only moves calls to new operator into the standard library. It has an advantage that you can ignore grepping for new calls in the standard library. But it does not save you from dangerous things like Rust does. Do you grep also for the get() member function of shared_ptr? How do you differentiate it from other get functions? It is no easy thing to automate auditing of C++ code. Though you probably can force your lint to scream at any naked (non-wrapped) pointer usage and allow it only in the s
Seriously. Their docs tell me that it can automate the really easy case with smart pointers that C++ does fine if you write sensible code. But what about the difficult stuff? How does it hanndel a linked list?
You have to work hard to get past all the propaganda to find the meat, if there is any. I have not had time.
What I have seen is that you use Rust essentially like old Visual Basic, with lots of variable length arrays that you ReDim (aka "Vectors"). An easy style to use safely with C++, and not a b
"Just think of a computer as hardware you can program."
-- Nigel de la Tierre
Wait a second... (Score:5, Insightful)
despite developers' positive feelings toward Rust, 97% of them hadn't actually used it.
Who says they love something they have not used???
I might say something seems decent, but no way would I say I *LOVE* a language until I've done a few real things in it.
The top issues that respondents say the Rust project could do to improve adoption of the language are better training and documentation, followed by better libraries, IDE integration, and improved compile times...
That is a pretty tall list of things that
Re: (Score:2)
I don't see why anyone would "love" any programming language.
I have looked at Rust and written some simple toy programs. But I don't use it for work.
The problems Rust claims to fix, such as memory leaks, buffer overflows, and safe threads, can be done in C++ with "safe pointers", proper programming practices, and coding standards.
So, with a huge code base of working C++, it doesn't make sense to switch. It would be yet-another-language that everyone we hire would need to know. We would be constantly swit
How to automate C++ auditing? (Score:1)
The problems Rust claims to fix, such as memory leaks, buffer overflows, and safe threads, can be done in C++ with "safe pointers", proper programming practices, and coding standards.
How do you automate auditing a C++ project for use of the sort of "proper programming practices and coding standards" that prevent the same problems that safe Rust prevents?
Re: (Score:2)
Re:How to automate C++ auditing? (Score:1)
If you are using new (or god forbid malloc) instead of the STL containers and class members to allocate and delete objects, you are setting yourself up for failure.
So no shared_ptr for you? No objects with dynamic lifetime? Looks like you would enjoy using linear type system like Rust has.
Re: (Score:2)
Re: (Score:0)
Dynamic lifetime - lifetime depending on program logic (not dependent on stack and not statically allocated). It is not infinite lifetime. You should de-allocate everything before exit. And objects with dynamic lifetime are de-allocated long time before exit most of the time.
You may not use new in your code when you use shared_ptr but it will be used in the library anyway (like e.g. in make_shared). shared_ptr does not avoid the really hard problem of memory management of C++ programs. It only makes it some
Re: (Score:2)
Re: (Score:0)
What does Rust actually do? (Score:2)
Seriously. Their docs tell me that it can automate the really easy case with smart pointers that C++ does fine if you write sensible code. But what about the difficult stuff? How does it hanndel a linked list?
You have to work hard to get past all the propaganda to find the meat, if there is any. I have not had time.
What I have seen is that you use Rust essentially like old Visual Basic, with lots of variable length arrays that you ReDim (aka "Vectors"). An easy style to use safely with C++, and not a b