Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
January 27, 2022 05:01 pm GMT

What is rust? Rust tutorial:1

Rust is a modern systems programming language. It is intended to be a language for highly concurrent and highly secure systems. It compiles to native code; hence, it is blazingly fast like C and C++.Rust is used where performance is absolutely critical. This tutorial adopts a simple and practical approach to describe the concepts of Rust programming.

Before starting you need to install rust,You can install it officially from Rustlang.
Notes:
Performance
Rust programming language does not have a Garbage Collector (GC) by design. This improves the performance at runtime.

Memory safety at compile time
Software built using Rust is safe from memory issues like dangling pointers, buffer overruns and memory leaks.

Multi-threaded applications
Rusts ownership and memory safety rules provide concurrency without data races.

Support for Web Assembly (WASM)
Web Assembly helps to execute high computation intensive algorithms in the browser, on embedded devices, or anywhere else. It runs at the speed of native code. Rust can be compiled to Web Assembly for fast, reliable execution.

Create a Rust App :
Rust uses a package manager called cargo,run cargo new rust_app from the terminal to create a new rust app.
Inside that folder you can see a source folder src inside that you can see the main.rs file.
That is where your main code starts executing.
function is defined by fn keyword
println!() prints the given value.
Run the rust code with rustc main.rs
and voila you created a highly efficient executable !
That's it for today,See you soon in another rust blog


Original Link: https://dev.to/dumboprogrammer/what-is-rust-rust-tutorial1-38do

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To