Rust is a system programming language. It runs blazingly fast, prevents almost all crashes and removes the ambiguities associated with sharing access to data. Mozilla developed it as a tool to create a new generation browser engine – Servo.

Similar Facilities

The given language definition sounds like a fairy tale, since the henceforth tools have always balanced between speed and reliability. At one point, C++, in which speed and facilities are compensated by constant access errors outside the allocated memory to the reclamated memory. Or the unexpected results of reading data that is being written in-parallel by another thread. On the other hand, there’s Haskell, a “stronghold” language (on the principle “since it compiles, it operates”), which can’t brag about speed, though. Somewhere in-between balance Java, Python, C# and other popular (due to their usability) languages. As for me, Rust is a successful crossing of the best C++ and Haskell facilities. It keeps usability at the level of competitors.

Rust features similar with C++:


Rust features similar with Haskell:


Reasons why Rust can be faster than C++:


Ad Astra per Aspera

All the Rust magic becomes possible thanks to the compiler knowledge about the owner of a particular entity (owner), the one borrowing it for some time (mutable borrow) and the one came to take a look at it (immutable borrow).
When programming in C++ or Java, you keep in mind this information anyway, even if in some other form. In the Rust language constructions express it. This allows the compiler to verify the accuracy of your model and guarantee its unproblematic execution. We need a bit different approach for such programming. I’ll review the basic things that may confuse you when learning the language:

  1. There’s no inheritance. But there’re structures and traits.
  2. There’re pointers in the unsafe code only (unsafe {}). There are references in the code instead of them. They point to the existing objects for sure.
  3. If you have an invariable reference to something (immutable borrow = &Object), no one can change it while the reference is active.
  4. If you have a variable reference (mutable borrow = &mut Object), no one other can read the object content while the reference is active.
  5. The language developers prefer Mac and *nix. Therefore, we’re going to need GNU environment for the operation on Windows.

Rust has a very cheerful and active community. You’re always welcome at IRC channel and on Reddit. Quite a lot of good projects have been written. Most of them are actively developing at GitHub. The language is especially popular among developers of games and graphics. There’re early stages of operating systems. In the long term there’s a possibility of executing on web-servers and clients. Rust is suitable for any task!

Perhaps, the most serious problem today is its rapid growth. The syntax may change from one version to another. Sometimes you need to rethink the logic when adjusting to new language facilities. This situation will take place during this year, till Rust-1.0 is released. Meanwhile, Rust 'n Stuffs magazine informs us about all the actual and future changes, with new articles and attractive projects in its weekly column.

Write your own articles at Kukuruku Hub

0 comments

Read Next

Hi Everyone! We are about to launch a new project very soon - CrowdMind.co. Sign up to get a private beta access!