Git Product home page Git Product logo

rust_intro's Introduction

v1.0.0

Last Updated: 01/05/24

Getting Started

Explore the projects in this repository to deepen your understanding of Rust:

  1. "README": Finish this doc to set up rust before moving on to the different projects listed below.
  2. "hello": An introduction to Rust. Compare the read-me file with the "hello" project you just created.
  3. "variables": Learn about variables with comprehensive explanations and code snippets.
  4. "functions": Delve into calculations, functions, and more.
  5. "module": Start exploring object-oriented programming concepts.
  6. In Progress... Stay tuned for more learning resources and projects.

Happy coding!

Rust_Intro

Welcome to Rust_Intro, your gateway to learning Rust! This guide will walk you through the process of installing Rust, setting up your initial projects, and provide step-by-step instructions for understanding the basics of Rust programming.

Installation

Start your Rust journey by installing Rust on your system. Visit Rust's official website and follow the installation instructions. The images below illustrate the installation process:

Rust Installation

Setup

Once the installation is complete, you'll find a new terminal pop-up. If not, run the executable manually. The image below demonstrates this process:

Rust Setup

Your First Project

Let's dive into creating your first Rust project. Open a new terminal, navigate to your desired working directory, and execute the following commands:

Windows Command Prompt:

  • Navigate back: cd..
  • Change to a specific path: cd /c:/path
  • List files and directories: dir
  • Change to a different drive: E:

Linux/macOS Terminal:

  • Navigate back: cd ..
  • Change to a specific path: cd /path
  • List files and directories: ls

Now, create a new project named "hello" by typing:

cargo new hello

Running Your Code

Enter the project directory with:

cd hello

Run the project:

cargo run

Your terminal should display "Hello, world!" as the output:

image

Understanding Cargo

  1. Cargo: Think of it as Rust's package manager, similar to Pip for Python or npm for JavaScript. But Cargo is more—it's also the build system, test runner, docs generator, and more. Check the version with:
cargo --version
  1. Hello, world! Code: You'll find the code responsible for printing "Hello, world!" in hello/src/main.rs.

image

Let's now go to the hello repo and continue with this first project.

rust_intro's People

Contributors

jvick1 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.