FUCK RUST

Rust is a systems language that prides itself on memory safety. Instead of sacrificing memory safety for performance like other languages might, it prides itself on having memory safety without sacrificing performance. The language is built from the bottom up for this goal of memory safety. Its ownership and blah blah allows for extreme amount memory saftey (these aren't important details for just know its really memory safe). This is the killer feature of Rust. This is because memory safety is a big problem according to this scholar source the majority of CVE are due to memory unsaftey source. Rust could remove the majority of CVE. There is more exciting things about Rust. It has a lot of modern features then other systems languages like C++, however this will mostly go over the memory safety feature Rust has here.

I personally think its annoying to program in Rust. Mostly because of its killer memory safety features, but who cares what I think. I have been programming C (and other languages that shall not be named) for most of my life, but I am sure I can get used to it if I spent enough time.

The Community

The best way to describe the community around Rust is a Reddit community. No one likes redditors other then redditors, but who cares about the community behind a language. It might be annoying if you want to participate in the community around a language, but who actually participates in a community a language has anyways. I personally don't care for circle jerking about a programming language on Reddit or some other public forum. A language is a tool not something to obsess about. At least, in the end, I'm sure there are plenty of Reddit bottom feeders to help you if you need help with something Rust related.

Time to throw away everything

After reading this so far I'm sure you are thrilled and EXCITED about Rust. RIGHT now you are probably emailing your boss/professor/friends/coworkers/girl friend/boy friend/your harem about the good word. It's the perfect time to throw away everything and rewrite it in Rust. The kingdom of the Cniles is over, the new kingdom of Rustlets will be upon us. Time to go on Reddit or other tech forums and shit on C/C++. Hold on, we don't just throw away perfectly good code when the next cool thing comes along. The biggest question and an important question is cost vs gain. You could spend a huge amount of man hours rewriting whatever you have right now that's in C++ in Rust, or you could maintain it and fix things as they come by or bugs are found. For most things this is the way to go. Rewriting could also introduce more bugs and issues. Even if the majority of CVE are memory safety bugs there is still plenty of other CVE that don't have to do with memory unsaftey that Rust cant protect you against. However, it is probably worth writing a few things in Rust for memory safety and might help with performance. You can read more about Mozilla and problems they encounter while doing this here.

Lets keep our most of our old code but all new code SHOULD be rewritten in Rust right?

No. This feature of memory safety isn't always important. The most prominent easy to understand example of this would be bare metal applications. Generally it's a sin to use dynamic memory. There isn't really a reason in most use cases. An over simplified example would be if you are creating a control system for a jet. The jet you are designing for has a max of 4 turrets. Why would you ever need to have it use less memory if you have 1 turret vs 4 turrets? The memory used doesn't depend on the system like it does on desktop. If you are dying for memory THAT BADLY you should be buying more memory not trying to do tricks to save memory. So for the most part your memory is static and there are VERY few cases will you ever need to uses dynamic memory in embedded applications in general. Places like Lockheed basically out right banned it from mission critical systems. STILL even with static memory there can be memory unsaftey issues. Going out of array bounds is one that comes off the top of the head. Rust helps with these too. However, there is already tools to check for bounds checking that might soon be implemented in GCC 10. You can read about it here. I'm sure Rust is able to do it better because the language is built around this idea.

So the plot thickens. If key features of Rust aren't that important for very important applications (the embedded market) still no reason NOT to use Rust right? Well there are plenty of reasons not to use Rust. Most programmers right out of college dont know Rust. They learn C. You can teach them Rust, but that costs time and time is money. This probably wont change since the job market wont anytime soon start switching to Rust and need Rust programmers, even then colleges will probably be slow to transition to it. Another reason is its annoying to deal with a multilingual project. VERY important libraries from STM are all written in C.(A lot of STM libraries are blazing fast and really nice) Are you going to call C functions from your Rust program when you can just use C? Probably not, it's probably not worth the hassle definitely not when key features of Rust aren't that important to the application you are working on. There is other issues such as the fact Rust isnt supported on all the embedded platforms that C is. While C is basically supported on all of them. To give Rust credit it is supported on the important ones, but still not all of them. Even on the supported platforms they don't seem to be a well supported and have a few issues but over all are fine.

A good question is, how many of the applications currently being written in C and other systems languages is it important to have memory safety? If I had to guess, quite a few. I'm not sure if there is any sources or ways to answer this question, but it is reasonable to say there is a quite a large amount of system language use cases is the embedded market. The catch 22 of this is if a large portion of a use case of a language has little to no reason to switch to Rust people will still use C. That means there will almost always be a large portion of the job market of C programmers. If there are always a large portion of the job market that are C programmers its easier to get a bunch of C programmers then Rust programmer. So even if it would be advantageous to write something in Rust there are plenty of pressures to write it in C instead.

Rusts Up Hill Battle

Probably Rust will become more popular and not end up like other similar attempts of replacing C/C++ like ADA. Which in fact had a similar idea of safety. The only code really left of ADA is now just just some legacy code in the defense industry that some poor soul has to maintain. It has many things going against it such as not being easy to pick up for people that already know C/C++ and its a slow transition to it. I wouldn't jump on the Rust train just yet and put all you eggs in one basket personally.