Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Do you people think Rust could take over from C for embedded? C++ has not really taken off there - while it's technically possible, it's mostly too complicated for the target audience.
C is simpler, but even C needs these MISRA rules so that the devs don't fuck up with the more dangerous features.
With Rust, I have heard that the compiler is more designed to prevent common faults by abandoning C's stance that the programmer knows what he's doing (he often doesn't). Is that your experience?
How is the ease of use with Rust compared to both C and C++? -
leanrob35636y@Fast-Nop Great question.
So, a bit of background. I haven’t worked with C or C++ since university. And to be honest, I was way more a fan of Java at that time. Basically, I don’t think I would take a job that was largely C++ or C based.
With that said, Rust is WAY better.
You are very right to say the compiler is on another level. Often time the compiler will say...
“You did X, did you mean to do Y?”
Then I do Y and the damn thing works!
I’m sitting there thinking... does this compiler need me? Should I have a job? Haha
But seriously, it’s much friendlier, but still super safe. There is NO bending of the rules in rust, let alone breaking rules. You either do things correctly or it screams (useful things) in your terminal.
Now, it isn’t without its faults. For example, it a little bit slow to compile. But you can then all I guess haha. -
leanrob35636y@crapped I’m from Newfoundland Canada. With all the snow and salt on the roads...
If you find a car without rust on it then it is either never driven or a summer car. Haha -
@leanrob yeah that's the kind of thing where C has only inofficially caught up, with better compiler warnings. But the stance "go cut yourself, haha" isn't productive.
I remember Pascal being stricter, but I had constant difficulties because it was too strict for real world usage. Can you bypass Rust rules if you explicitely give some sort of compiler hint?
How is the learning curve for Rust? I'm senior C dev, but have given up on C++ because the insane time I'd need to invest doesn't give me enough return für mid-sized projects.
Long compile times with Rust aren't a problem with the project size I typically have in bare metal embedded.
I just feel that C might not cut it in my domain in the long run with all these easy bug possibilities. Something flexible, easy, and without big runtime would be a future. -
leanrob35636y@Fast-Nop In terms of learning curve I would have to say it’s not too bad.
Of course, that is subjective to the person at hand.
I’ve always been the type to love to learn new languages and frameworks (but always for a defined goal). Every time I try to learn something for fun I don’t usually get it until I build a real project.
However, I also know some very senior devs that are REALLY against learning new things unless they really have to. So for them so would say it would be more difficult.
Really a case by case basis. But overall a I have found it pretty good to learn.
We are using Actix-web as well to implement the Actor Model and the major problem with that is lack of docs and guides. It a bit more of a trial and read the source code type of thing.
Overall, I’d say go for it bud! Learn that rusty shit!
I don’t think you will regret it. I don’t. -
@leanrob I consider myself a C expert programmer, and my life is too short to get to that level with C++. I'd hate if I were coding with only a rough understanding. The big power of abstraction is obfuscation to me if I can't easily imagine the resulting assembly. I do admire that C++ cracks who can do that, though.
But if you say Rust isn't too bad, I think I can put that on my list. While I absolutely love C, I fear that I may become unemployable with C only with all its inherent security issues.
thx man! :-) -
@Fast-Nop Another Rust dev here, and I must say it's absolutely amazing. While it isn't as permissive as C, you are still able to do a lot of unsafe stuff and just abstract that away with the extremely powerful type system. It does let you use low-level stuff (lol check my project called beeOS which for example uses the HW clock and VGA buffer), but you should really avoid most unless necessary, and you should abstract it gone.
-
@Fast-Nop Writing a code that compiles in Rust is way harder than C/C++. However, if you can compile the code at least it is guaranteed that you won't face with segfaults, null pointers or an other problem like these. (Excluding unsafe blocks)
-
@Proximyst
Guys, I'm not a low level dev, TBH I don't even have a CS degree as I'm from Civil. So consider my knowledge at lowlevel stuff is zero. I'm good at programming and product designing.
So.., I'm thinking of picking up rust for next project. ( I haven't decided, it is just to learn Rust ). I have experience with go. IMHO go looks cleaner and more readable. So my question is why do you guys use Rust? What purpose you use it for? Where all I should avoid Rust?
Related Rants
-
kiki11Git. The smallest utility made its way to being the largest companies must-have, the most critical part of t...
-
AlgoRythm12Visual Studio Code! It's Microsoft showing Atom that they can copy Sublime Text better ;)
-
leanrob10Sometime I’m developing in Rust and I do something wrong. Then I look at the terminal and it says... “Yo...
Rust is my favourite open source project.
Because rust is fucking awesome!
rant
rust
wk120