Take The Beginner's Series to Rust
Written by Nikos Vaggalis   
Thursday, 14 July 2022

Microsoft has released a new self-paced and free curriculum for total beginners in Rust, taught by Microsoft's own employees. But first of all why Rust? why go for Rust as a beginner when there's so much choice?


rust

Rust was Mozilla's brainchild first announced in 2010 and released in 2015. Its official definition and purpose in life was to be:

“a systems programming language focused on three goals: safety, speed, and concurrency.”

three concepts that no language could cover 100%. In particular, Rust was going to fill the safety gap by making all the erroneous, dangerous and unsafe operations found in the C-derived languages very hard to repeat, in essence eliminating entire classes of errors. This would result in higher-quality software, but traded for a steeper learning curve..

In "Rust Gets Into The Kernel", Harry Fairhead puts it into perspective 

If language support in Linux needs extending, then the obvious one to choose is C++ and probably not Rust. So why not? The answer is mostly that Linus hates C++ and rightly so. If you regard C as being a language that it is easy to make mistakes in, C++ is almost designed to make subtle errors easier to write. While there are advantages in allowing modest extensions of C to include basic C++ objects, say, allowing the whole language in would result in a lower quality kernel.

So what about Rust?

Rust is supposedly a better and safer language with advanced features, notably the concepts of ownership and borrowing ownership. It is arguably more difficult to accidentally fall into the traps of buffer overrun, use after free and null pointer problems in Rust - but all this depends on not resorting to using the unsafe keyword which exposes Rust to the same dangers of C, but makes writing code easier.

Microsoft lately having embraced many other programming languages together in harmony with its .NET ones, created a curriculum to ease making the first steps into the language.

It comprises 35 short videos, up to 10 minutes each, and a Github repository where the associated exercises reside. The videos set out to teach:

 

  • Why you should learn Rust
  • The Rust community
  • How to setup your development environment for Rust
  • How to create and run Rust programs
  • How to use Cargo
  • The different data types and how to use them
  • Functions
  • Control flow
  • Error handling
  • Borrowing
  • Ownership
  • Strings
  • Collections
  • Traits

 

The playlist is:

  1 - Introduction to the series
  2 - What is Rust and why should you learn it
  3 - Learn about the Rust community
  4 - Install the tools to develop with Rust
  5 - Create your first application
  6 - What is Cargo?
  7 - Learn about variables
  8 - Demo: Declare and use variables
  9 - Learn about scalar data types
10 - Demo: Create and use scalar data types 1
11 - Learn about compound data types 1
12 - Demo: Create and use compound data types 1
13 - Functions 1
14 - Demo: Functions 1
15 - Structs 1
16 - Demo: Structs 1
17 - Enums 1
18 - Demo: Enums 1
19 - If/else and match 1
20 - Demo: If/else and match 2
21 - Loops 2
22 - Demo: Loops 2
23 - Error handling 2
24 - Demo: Error handling 2
25 - Ownership 2
26 - Demo: Ownership 2
27 - Borrowing 2
28 - Demo: Borrowing 2
29 - Learn about strings 2
30 - Demo: Create and use strings 3
31 - Collections
32 - Demo: Collections
33 - Traits
34 - Demo: Traits
35 - Next steps

As is evident, the videos come in pairs; one outlining the theory behind the concept and the next one demoing the source code.

The target group is developers who have knowledge in another programming language and want to learn Rust. Certainly a background in C/C++ will make it much easier to make the transition since prior knowledge of C will highlight what problems Rust solves for you. By the end of this series, you will have enough knowledge to go forth and write your own Rust programs.

It is certainly a beginner-friendly course which uses easy-to-understand language in order to convey the concepts, along with the instructors' attitude that fosters positivity. Both very valuable for a beginner.

As far as what you can do having learned Rust, Rust can be used just about everywhere - systems programming; web APIs; tools and utilities, desktop and mobile applications, and of course in gaming, challenging C++'s domination on the field. Well, it lacks a bit in the GUI space as documented by the Are We GUI Yet website:

There are a number of bindings available today to existing frameworks, but those looking for a mature, easy to use, and completely Rust-based solution will most likely find themselves out of luck.

But I guess that is something that will be resolved soon.


rust

 

More Information

Beginner's Series to Rust videos

Beginner's Series to Rust Github

Related Articles

Take Microsoft's Java For Beginners

Microsoft's Machine Learning for Beginners

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


TypeScript 5.6 Tightens Truthy And Nullish Checks
16/09/2024

TypeScript 5.6 has been released. The update has better handling of truthy and nullish checks and new iterator helper methods.



TIOBE Says C Is Declining!
11/09/2024

The TIOBE index is always fun and often provides a talking point. This month sees C falling by one place and Java going up by one. What can this mean?


More News

kotlin book

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Thursday, 14 July 2022 )