Rust is a multi-paradigm, general-purpose programming language designed for performance and safety, especially safe concurrency. Let's get started with RUST programming language.
RUST installation on Windows
rust
Download latest rustup-init.exe
from rust
website
or click here
to download rustup-init.exe(64 bit)
.
Rust
Run the downloaded rustup-init.exe
and in the prompt press "1"
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1
Once the installation is complete you should see output similar to as shown below
stable-x86_64-pc-windows-msvc installed - rustc 1.57.0 (f1edd0429 2021-11-29)
Rust is installed now. Great!
To get started you may need to restart your current shell.
This would reload its PATH environment variable to include
Cargo's bin directory (%USERPROFILE%\.cargo\bin).
Press the Enter key to continue.
Rust
installationRun below command to check rust
version
rustc --version
rustc 1.57.0 (f1edd0429 2021-11-29)
Now RUST has been installed, lets create our first program in RUST with VSCode.
CMD
E:\rust-tutorials>mkdir first-project
VsCode
in it.
E:\rust-tutorials>cd first-project
E:\rust-tutorials\first-project>code .
VsCode
create a file main.rs
and write below code and save the file
fn main() {
println!("Hello, rust!");
}
Rust
program, open the terminal and execute below command, on successful execution
it will create main.exe
.
E:\rust-tutorials\first-project>rustc main.rs
Rust
program, execute below command
E:\rust-tutorials\first-project>.\main.exe
Successful execution will print "Hello, rust!"
in the terminal
Category: RUST