# 1. Hello World! (Rust) Rust has quickly become one of the most used programming languages in today's world. There has always been talks about what language would be the successor of C. Currently whether it is the linux, windows, or mac kernel, C has been the language of choice. However, ever more recently there has been continuous talks of switching the Linux kernel from C to Rust. Rust has had a steady rise in popularity over the last few years, and in April of 2021 Google announced that they will be transitioning the low level parts of their operating system to Rust Source. This makes sense in a lot of ways as Rust provides a lot of type safety and memory safety, which is something that C does not provide. The goal of this tutorial is to get familiar with Rust and to understand the best ways to implement this technology. ## Setting up the environment To set up our environemnt, we must first install rust. * Install on mac: ``` curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` * Install on windows download .exe here: [Link](https://static.rust-lang.org/rustup/dist/i686-pc-windows-gnu/rustup-init.exe) This will install three important packages: rustup, cargo, and rust. **Rustup** is the main installer for rust and is in charge of keeping the language updated. **Cargo** is the main package manager for Rust Cargo downloads your Rust package's dependencies, compiles your packages, makes distributable packages, and uploads them to crates.io, the Rust community’s package registry. Finally, **Rustc** is the main compiler for Rust and is often run with cargo when building the project but can be ran seperately. We will explore all three of these further on. ## Hello world For our first project let's work on a simple Hello World program. Once we have all of our necessary packages installed, we can begin making our first file. We're going to make a file called *HelloWorld.rs*. Once we open the file we are going to write: ``` fn main(){ println!("Hello World!"); } ``` fn main() is our main method, and prinln! is a [macro](https://doc.rust-lang.org/rust-by-example/macros.html) that prints the text to the console. To compile this code we simply run ``` rustc HelloWorld.rs ./HelloWorld ``` And there you have it! We have our first code compiled! In the text section we are going to talk about the structure of Rust and some other simple programs we can use. ## [Continue to next section...](https://hackmd.io/@parsa-cu/rust-part-2)