If anyone wants to get their feet wet with embedded Rust, The Discovery Book is a introductory tutorial using the STM32F3DISCOVERY board. Fair warning, it is not a tutorial on the Rust language itself. There's also The embedded Rust book, and The embedonomicon for more in-depth coverage.
Agreed, but neither should they stay with something when something better is available. For example, I was once offered a job in a company that made core memory when semiconductor memory was available!
You miss a critical point: presuming it is even possible that can only be achieved in a subset of C++. And every person/group/company chooses a slightly different subset.
Now try to guarantee your program's properties when using libraries from 10 different sources - you simply cannot.
Quote
Agreed, but neither should they stay with something when something better is available. For example, I was once offered a job in a company that made core memory when semiconductor memory was available!
You imply the difference between Rust and C++ is like the difference between core and semiconductor memory?
So with Rust your memory needs a tiny fraction of the space?
So with Rust your memory becomes thousands of times faster?
So Rust makes your memory super cheap?
As software engineering is not a physical device, the somewhat physical thing here is the engineer. And you say if this engineer is using Rust he will get these dramatic improvements?
Yours are the typical cheers of someone wanting to suggest a benefit to people - if they believe him - that never can materialize.
QuoteYou miss a critical point: presuming it is even possible that can only be achieved in a subset of C++. And every person/group/company chooses a slightly different subset.
Now try to guarantee your program's properties when using libraries from 10 different sources - you simply cannot.
They can choose, what is wrong with that?
It seems Rust only limits these choices, you say it is only for the "good", but maybe too intrusive or limiting, i don't know.
So you imply engineers are too stupid or lazy to deal with their freedom and responsibility to install proper coding guidelines and proper tools themselves,
This is quite pretentious, you know?
And why do you think over time (or even already) the available libraries in Rust will not just become quite similar, have similar problems, because after all it is more about the people doing them, not the slight variation of a language these are coded it in?
Out of curiosity, what is your background and experience?
I'm a professional engineer that has been using C and other languages since 1981, and been designing and implementing systems ranging from low-noise analogue electronics and RF, through soft and hard realtime digital+software systems, to high availability telecoms systems. Hence I do have considerable experience in such systems work, and how they can fail.
Out of curiosity, what is your background and experience?
I'm a professional engineer that has been using C and other languages since 1981, and been designing and implementing systems ranging from low-noise analogue electronics and RF, through soft and hard realtime digital+software systems, to high availability telecoms systems. Hence I do have considerable experience in such systems work, and how they can fail.
"How they can fail" ... the most important experience a designer can get imho.
So you imply engineers are too stupid or lazy to deal with their freedom and responsibility to install proper coding guidelines and proper tools themselves
So you imply engineers are too stupid or lazy to deal with their freedom and responsibility to install proper coding guidelines and proper tools themselves
Only the ones not considering alternative languages to avoid the common memory errors in C.
Which until recently was far far too many of them. They'd rather kludge on with tools and coding practices which can't even guarantee absence of those memory errors. Like good old MISRA C ... fat lot of good that did THREADX.
So you imply engineers are too stupid or lazy to deal with their freedom and responsibility to install proper coding guidelines and proper tools themselves
Only the ones not considering alternative languages to avoid the common memory errors in C.
Which until recently was far far too many of them. They'd rather kludge on with tools and coding practices which can't even guarantee absence of those memory errors. Like good old MISRA C ... fat lot of good that did THREADX.
No need for a new language, just use smart pointers (which you can have since >20 years in C++), std::string, std::vector, etc. and proper coding techniques.
Out of curiosity, what is your background and experience?
I'm a professional engineer that has been using C and other languages since 1981, and been designing and implementing systems ranging from low-noise analogue electronics and RF, through soft and hard realtime digital+software systems, to high availability telecoms systems. Hence I do have considerable experience in such systems work, and how they can fail.
Quote
Agreed, but neither should they stay with something when something better is available. For example, I was once offered a job in a company that made core memory when semiconductor memory was available!
You imply the difference between Rust and C++ is like the difference between core and semiconductor memory?
So with Rust your memory needs a tiny fraction of the space?
So with Rust your memory becomes thousands of times faster?
So Rust makes your memory super cheap?
I don't imply that, so those statements are irrelevant.
QuoteQuoteYou miss a critical point: presuming it is even possible that can only be achieved in a subset of C++. And every person/group/company chooses a slightly different subset.
Now try to guarantee your program's properties when using libraries from 10 different sources - you simply cannot.
They can choose, what is wrong with that?
The problem is that people make poor choices, some of which can be avoided by using a better tool.
The "escape clause" in any such guarantee is, of course, "and proper coding techniques".
Even without smart pointers, there are "proper coding techniques". Demonstrably programmers don't use them, so smart pointer will be convenient but insufficient.
Alternatively, if programmers did use "proper coding techniques", then smart pointers would be convenient but unnecessary.
That's the problem with the real world: you have to assume imperfect people, and choose your strategy to take that into account. Hence, if C++ is the answer, just what was the question?
Out of curiosity, what is your background and experience?
I'm a professional engineer that has been using C and other languages since 1981, and been designing and implementing systems ranging from low-noise analogue electronics and RF, through soft and hard realtime digital+software systems, to high availability telecoms systems. Hence I do have considerable experience in such systems work, and how they can fail.
Someone might note that you could have used C++ then instead of C as it was a way to avoid common errors, improve abstraction and ease coding.
A very successful and quite groundbreaking way, back then and still today.
The "escape clause" in any such guarantee is, of course, "and proper coding techniques".
Even without smart pointers, there are "proper coding techniques". Demonstrably programmers don't use them, so smart pointer will be convenient but insufficient.
Alternatively, if programmers did use "proper coding techniques", then smart pointers would be convenient but unnecessary.
That's the problem with the real world: you have to assume imperfect people, and choose your strategy to take that into account. Hence, if C++ is the answer, just what was the question?
You call smart pointers in C++ unnecessary but convenient and advertise Rust having a kind of elaborated smart pointer implicitly built in?
I think you made my point clear, thank you.
Oh, I did look at C++ and Objective-C in 1988. C++ didn't add any significant practical benefits, and introduced a whole new lot of traps. Even Soustroup said (and says) as much. If you dout
that, have a look at the C++ FQA, and alternately weep and giggle. https://yosefk.com/c++fqa/
Objective-C did add benefits, since it took inspiration from Smalltalk.
Oh, I did look at C++ and Objective-C in 1988. C++ didn't add any significant practical benefits, and introduced a whole new lot of traps. Even Soustroup said (and says) as much. If you dout
that, have a look at the C++ FQA, and alternately weep and giggle. https://yosefk.com/c++fqa/
Objective-C did add benefits, since it took inspiration from Smalltalk.Its a pity Stroustroup didn't look more closely at Objective-C. It has better functionality than (at least the early) C++, but I find the syntax of C++ more readable. Readable is good for reducing stupid errors.
More than this I wish there had been a true C++. A genuine incremental step from C that includes the basic structuring aspects of C++, like classes, but doesn't have all the stuff that can have serious performance issues, but only benefits a few applications. Sure, you can use C++ and try to avoid that stuff, but it only takes one slip.....
Again, I ask "what is your background and experience?". The reason I ask is because your statements are typical of those that have some small-scale experience of a language, but have little experience of how things work (and fail) in larger, longer-lived projects.
The detailed differences are important, both practically and theoretically. A key consideration is not any one feature in isolation, but how the sum of the features work together.
If you think that, then you understand less than you think.
Again, I ask "what is your background and experience?". The reason I ask is because your statements are typical of those that have some small-scale experience of a language, but have little experience of how things work (and fail) in larger, longer-lived projects.
This is your argument? What about the subject?
So you say only what you call a "large scale" and "long lived" project is a valid project?
You again expose yourself as a authoritarian supremacist, but i hope you are retired and don't bother engineers anymore.
Your statements are typical of a bureaucrat that likes to take his place of power in the hierarchy of a big company, not being productive but more a politician or even activist.
I can assure you, even without your "advice", people will succeed in solving their problems adequately in their way, just as they did before you.
std::string a = "a";
std::string_view b = a + "b\n";
std::cout << b;So... What happens?string_view gives you read-only access to another string, but a+"b\n" is just an rvalue without permanence (or is it?) Do you get a pointer off into space that no longer exists, or some sort of memory leak?
Your as hominem attack is very wide of the mark.
Given that you continue to avoid telling us your experience and background, I think we are justified in presuming you have little real world experience of creating medium or large commercial programs.
Experience does matter. It makes you humbler and more aware of how difficult it is to avoid things failing.
I prefer to recommend C# these days.