Simple (and shallow) introduction to Rust programming language (in my own way of course)

Beware! This article is for anybody who loves challenges! BTW, this article won’t tell you much, that’s why you need to stay curious!

Fatah Nur Alam Majid
3 min readFeb 28, 2020
Source : Google Images

TL; DR

Who knows that I might be a Rustacean today? Well, simply put, Rustacean is a term for programmers that uses Rust for their programming language. Sure nobody knows. Neither myself didn’t know that I would be a Rustacean today. What’s more surprising is that I even published my first crate into public. This can’t be achieved if my friends aren’t giving me support back then, thanks to them. And to you guys who would like to check the crates you can open it here.

The background

I thought learning Rust-lang would be a difficult decision to be done. But in reality I didn’t know how hard it is because actually I’m not even trying. So I encouraged myself to take that path to learn this relatively new language. Started by setting up my laptop so it is installed with the Rust toolchain, including its compiler. In first I didn’t know where to look for the tutorial to learn this language, so I searched for it. But in fact that Rust provides its official book in their toolchain is another level of hints to solve my problem here.

The book

The book sure is complete. You can understand how Rust work simply by reading the book. By the way, Rust provides many books on their own, for example they are not only provide its programming language book but they also provide its cargo book. Cargo is one of its toolchain that act like a package manager for Rust. It can be used to download or upload (or publish) Rust packages (called crates), install it, or update your Rust project so it will depends on the latest package available on its official registry.

The shortcut

For you guys who aren’t really into books you can read some compact tutorials through the internet. A lot of Rust tutorial now have been published. Back then one of my friends was also suggesting me a GitHub repository that has a compact and simple Rust code by example. Well, it’s a public access repository and I’m not keeping it for myself so here’s the page I mentioned before. That page sure gives you some compact code for you who wants to learn Rust in fast-paced style, or maybe by hands-on. Well, everyone has their own learning style of course.

The playground

For you guys who wants to learn Rust but not having its toolchain installed, don’t be sad. Rust themselves provide a playground or sandbox to run some of its code so you can write your own online. The playground is here, you can check it for yourself and play until you bored with it!

The new mechanism

Rust is a relatively new language, but what’s make it so different between Rust than the other languages? After you read some tutorial you will know that Rust has a new mechanism to introduce, that’s called the ownership. The ownership didn’t come for itself, it also comes with two of its friends called borrowing and lifetime. While having this new feature to introduce, Rust also accompany all of them with more advanced compiler (since Rust is a compiled language) to prevent most of people doing the wrong things. A question, why does the compiler are called more advanced than the other? Aren’t they just the same compiler? Well, it might be true that all of compilers are really a compiler. But, the more specific answer to that question is that because tje Rust’s compiler also has a new feature called lifetime checker and borrow checker. Well, I’m not gonna tell you about it in depth, you can learn that on your own, I’ll leave it to you.

Closing

Right, that’s it. That’s some simple things I learned about this relatively new language, Rust. If you’re a person that loves challenges then you should learn this language. In the beginning it was full of struggle to understand how this new language work, but in the end you will enjoy it (while you might still have enormous amount of compiling error LOL, just kidding). Good luck!

--

--

Fatah Nur Alam Majid

Tech hobbyist, Learn from scratch, Learning the hard way, Just want to share anything