![]() That’s where the code for our project will live. Src/main.rs is the entry file of every Rust project. It’s where you keep metadata for your project, as well as dependencies. This will generate a new folder called i-am-a-rustacean with the following files in it: i-am-a-rustaceanĬargo.toml is the manifest file for Rust. With your terminal, navigate to the folder where you want to create the project and run the command below: $ cargo new i-am-a-rustacean With Rust and Cargo installed, we can create our first Rust project. ![]() We will be using it to create new Rust projects, build them and even add external dependencies in them. It is the Rust build tool that gets installed automatically when you install Rust. Now, you might be asking yourself what Cargo is. Something like this: cargo 1.49.0 (d00d64df9 ). ![]() If the installation was successful, you should see the version of Cargo in your terminal. To check that, start a new terminal window and run the following command: $ cargo -version You should now have Rust installed on your computer. This command will download and run rustup-init.sh which in turn will download and run the correct version of the rustup-init executable for your platform. If you are on a Unix-like system (Mac OS, Debian, Ubuntu…), run the following command in your terminal: $ curl -sSf | sh Run the downloaded file when it completes and just follow the instructions. To install Rust on Windows, head over to and click on the download rust-init.exe button corresponding to your operating system’s architecture (32-bit or 64-bit). Rust is a bit of a hybrid, according to Mozillas Rust documentation. We will install Rust and write a simple program that prints something in the console. Let’s get started with the Rust Programming Language. Meet Ferris, the unofficial mascot of Rust Getting started with Rust No prior experience in programming is required to follow along. In the first part of the series, I will just go through the installation of Rust and the creation of a new Rust project. It has some cool features that make me think of Python and some others that are totally out of this world! So I decided to write a series of posts to share my thoughts on the language. I was just exploring to see what it’s like to write code in Rust and I ended up considering it for some of my future projects. My Rust Programming Journey: Part 1 - Getting startedĪ week ago, I started learning the Rust Programming Language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |