Rust is a system programming language which runs blazingly fast, and prevents almost all crashes,[segfaults](https://wikipedia.org/wiki/Segmentation_fault), and dataraces.You might wonder exactly why yet another programming language is useful, since there arealready so many ofthem. This article aimsto explain why.
You may haveseen a diagram of the abovespectrum. On one side there’sC/C++, which has more control of the hardware it’s running on. Therefore it letsthe developer optimize performance by executing finer control over the generatedmachine code. However, this isn’t very safe; it’s easier tocause a segfault, or security bugs like[Heartbleed](https://fedoramagazine.org/update-on-cve-2014-0160-aka-heartbleed/).
On the other hand, there arelanguages like Python, Ruby, and JavaScript where the developer has little control but createssafer code. The code can’tgenerate a segfault, although it can generateexceptions whichare fairlysafe and contained.
Somewhere in the middle, there’s Java and a few other languages which are a mixture ofthese characteristics. They offer somecontrol of the hardware they run on but try to minimizevulnerabilities.
Rust is a bit different, and doesn’t fall in this spectrum. Instead it gives the developer bothsafety and control.
### Specialties of Rust
Rust is a system programming language like C/C++, except thatit gives the developer fine grained control over memory allocations. A garbage collector is not required. It has a minimal runtime, and runsvery close to the bare metal. The developer has greaterguarantees about the performance of the code. Furthermore, anyone who knows C/C++ can understand and write code for this language.
Rust runs blazingly fast, sinceit’sa compiled language. It uses LLVM as the compiler backend and can tap into a large suite of optimizations. In manyareas itcan performbetter than C/C++.Like JavaScript, Ruby, and Python, it’s safe by default, meaningit doesn’t cause segfaults, dangling pointers, or null pointers.
Anotherimportant feature is theelimination of data races. Nowadays,mostcomputers have multiplecores and many threads running in parallel. However it’s tough for developers to write good parallel code, so this feature removes that necessity. There are twokey concepts Rust uses to eliminate data races:
* Ownership.Each variable ismovedto a new location, and prevents the previous location from using it. There is onlyoneowner of each piece of data.
* Borrowing.Owned values can beborrowedto allow usage for a certain period of time.
### Rust in Fedora 24 and 25
To get started, just install the package:
```
sudo dnf install rust
```
```
fn main() {
println!("Hello, Rust is running on Fedora 25 Alpha!");
}
```
```
rustc helloworld.rs
./helloworld
```
Run the following command to install the latest testing version on Fedora: