Hi Friends!,
I am planning to dive more into exciting coding projects and challenges that'll turn you into a coding superhero in the forth coming newsletters! So get your gears up!
🦀 Meet Rust - Your New Best Coding Friend: Find out why everyone loves Rust! It's memory safe, super fast, provides zero-cost abstraction & more..
Let’s Write🚀 Your First Rust Program: Join the fun! Follow these easy steps to write your first Rust program using Visual Studio Code.
💻 Step by Step Guide:
Install Rust: Before you start coding in Rust, you need to have Rust installed on your system. You can install Rust by following the instructions on the official Rust website: Install Rust.
Install Visual Studio Code: If you don't have Visual Studio Code installed, you can download and install it from the official website: Visual Studio Code.
Install the Rust Extension for Visual Studio Code: Open Visual Studio Code, go to the Extensions view (
Ctrl+Shift+X
orCmd+Shift+X
), and search for "Rust." Install the extension provided by the Rust Programming Language. This extension provides Rust language support and various tools for Rust development.Create a New Rust Project: Open a terminal and navigate to the directory where you want to create your Rust project. Run the following command to create a new Rust project using Cargo (Rust's package manager):
cargo new my_first_rust_project
This command will create a new directory named my_first_rust_project
with the basic structure of a Rust project.
Open the Project in Visual Studio Code: Open Visual Studio Code and use the "Open Folder" option to open your newly created project folder (
my_first_rust_project
in this example).Edit the
main.rs
File: Inside your project folder, you'll find a file namedmain.rs
in thesrc
directory. Open this file in the editor. It contains a simple "Hello, world!" program by default.
fn main()
{
println!("Hello, world!");
}
Run the Program: In VSCode, open the integrated terminal (
Ctrl+`` or
View > Terminal), navigate to the project directory (
cd my_first_rust_project`), and run your program using Cargo:
cargo run
Cargo will compile and run your Rust program, and you should see the output "Hello, world!" in the terminal.
🎉Congratulations! You've just written and run your first Rust program in Visual Studio Code. From here, you can explore more Rust features, libraries, and tools to continue your Rust development journey.
💌 Share the Fun: Tell your coding buddies about this adventure. Let's code together and make learning awesome!
🚀 Coming Soon: More Coding Fun! Stay tuned for next week's coding journey. I'm excited to hear your thoughts—share them in the reply to this email. Until then, happy coding!
🔗 Connect with Me:
🎥 Subscribe to my YouTube Channel: Let's Code Together
✍️ Subscribe to my Medium Blog: Enravish Jeni
👥 Find me on LinkedIn: Jenifer Rajendren
🐦 Twitter: @enravishjeni411
📸 Instagram: Jenifer Rajendren
Bye for now, and happy coding!