<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mayur Kumbhar on Medium]]></title>
        <description><![CDATA[Stories by Mayur Kumbhar on Medium]]></description>
        <link>https://medium.com/@themayurkumbhar?source=rss-17f52f3e1b52------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*G6A461RDovYxj0GVXDZlWA.jpeg</url>
            <title>Stories by Mayur Kumbhar on Medium</title>
            <link>https://medium.com/@themayurkumbhar?source=rss-17f52f3e1b52------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 16:51:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@themayurkumbhar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Learning Rust: Control Flow]]></title>
            <link>https://medium.com/@themayurkumbhar/learning-rust-control-flow-fb54da0761dd?source=rss-17f52f3e1b52------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb54da0761dd</guid>
            <category><![CDATA[rust-programming-language]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[fundamentals]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[rust-programming]]></category>
            <dc:creator><![CDATA[Mayur Kumbhar]]></dc:creator>
            <pubDate>Sat, 27 Sep 2025 10:48:07 GMT</pubDate>
            <atom:updated>2025-09-27T11:34:12.228Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*D3nDPDpy-KI8y43swgLlnw@2x.jpeg" /></figure><p>Continue to our <a href="https://medium.com/@themayurkumbhar/rust-101-the-fundamentals-a07eba0ffd1f">rust language journey</a>, today we are leaning how control flow works in the rust programming language.</p><h3><strong>if</strong> Expressions and Loops</h3><p>Control flow structures allow your program to make decisions and repeat actions. Rust handles these using if expressions and three types of loops.</p><h4>1. Conditional Execution: if Expressions</h4><ul><li><strong>Boolean Requirement:</strong> The condition in an if block <strong>must</strong> evaluate to a <strong>bool</strong> — true or false. Rust does not automatically convert non-boolean values.</li><li><strong>Structure:</strong> Uses if, else if, and else blocks.</li><li><strong>if as an Expression:</strong> Unlike in many languages, if is an <strong>expression</strong>, meaning it can return a value. This is often used for concise variable assignment.</li></ul><p><strong>Code Example:</strong></p><pre>fn main() {<br>  let condition = true;<br>  <br>  // The return types of all blocks MUST be the same (here, i32)<br>  let number = if condition { 5 } else { 6 }; <br><br>  println!(&quot;Number is {}&quot;, number); // Prints: Number is 5<br>}</pre><h4>2. Iteration: Loops</h4><p>Rust provides three explicit loop keywords for repeated execution of code repeatedly until a contidion is met or a collection is exhausted:</p><ul><li><strong>The Infinite Loop </strong>— loop</li></ul><p>The loop keyword create a perpetual loop that runs indefinitely. This structure is used when you need to repeat an action until you manually exit. You must use the break keyword to terminate a loop . Importantly, loop is an <strong>expression </strong>and can return a value when it breaks, making it useful for retry logic or simple calculations.</p><pre><br>fn main() {<br>    let mut count = 0;<br>    let result = loop {<br>        count += 1;<br>        if count == 5 {<br>            break count * 2; // Returns 10<br>        }<br>    };<br>    println!(&quot;Result: {}&quot;, result); // Prints: Result: 10<br>}</pre><ul><li><strong>The Conditional Loop — </strong>while</li></ul><p>The while loop runs a block of code only as long as a specified Boolean <strong>condition</strong> remains true. This is sutaible when you don’t know the exact number of iterations needed, but you know the condition that must be met to stop.</p><pre><br>fn main() {<br>  let mut number = 3;<br>  while number != 0 {<br>      println!(&quot;{}!&quot;, number); // prints: 3! 2! 1!<br>      number -= 1;<br>  }<br>}<br></pre><ul><li><strong>The Iterator Loop — </strong>idiomatic for</li></ul><p>The for <strong>loop</strong> is the most common and idiomatic way to loop in rust. It safely iterates over the items of collection like an array or a range, managing the index and termination for you. it works with <strong>iterators</strong>, which prevents common <strong>off-by-one</strong> errors and improves code safety. Ranges can be defined as inclusive ( 1..=10 ) or exclusive ( 1..10 ).</p><pre><br>fn main() {<br>  let nums = [10, 20, 30, 40, 50];<br>  // Iterates safely over each element in the array `nums`<br>  for element in nums {<br>      println!(&quot;The value is: {}&quot;, element);<br>  }<br>}<br></pre><p>Lets look at <strong>inclusive range</strong> example:</p><pre><br><br>fn main() {<br>  // Lets print only 5 numbers inclusive 1..=5<br>  for index in 1..=5 {<br>      println!(&quot;Countdown: {}&quot;, index); // prints 1 2 3 4 5<br>  }<br>}</pre><p>Similarly, <strong>Exclusive range</strong> example:</p><pre><br><br><br>fn main() {<br>  // Lets print only 4 numbers exclusive 1..5<br>  for index in 1..5 {<br>      println!(&quot;Countdown: {}&quot;, index); // prints 1 2 3 4<br>  }<br>}<br></pre><p>That’s pretty much it for loops! You now know how to control the flow and logic of your rust programs! Keep experimenting with Rust’s control flow, and try building a small project like a command-line game to see its power in action!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb54da0761dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rust Essentials: Variables, Constants, and Mutability Explained for Beginners]]></title>
            <link>https://medium.com/@themayurkumbhar/rust-essentials-variables-constants-and-mutability-explained-for-beginners-bcb00cdbbbf7?source=rss-17f52f3e1b52------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcb00cdbbbf7</guid>
            <category><![CDATA[rustlang]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[rust-programming-language]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming-languages]]></category>
            <dc:creator><![CDATA[Mayur Kumbhar]]></dc:creator>
            <pubDate>Fri, 23 May 2025 15:35:17 GMT</pubDate>
            <atom:updated>2025-09-27T08:59:47.951Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*bfdwqpWWiJPQh59fCWmWZg@2x.jpeg" /></figure><p>Continuing to our <a href="https://medium.com/@themayurkumbhar/rust-essentials-how-to-set-up-your-development-environment-36d5414e0a3e">last post</a> on the rust language fundamentals, today we will discuss on language foundations. What are variables, constants and Mutability works in Rust.</p><p>Understanding how to store and manage data is fundamental. Rust has specific rules around the variables and mutability that are key to its safety guarantees.</p><h3>1. Variables with let :</h3><ul><li>Variables are declared using the let keyword:</li></ul><pre><br>let variable_name = value;<br></pre><p>Example:</p><pre><br>let my_var = 5;<br></pre><h3>2. Immutability by Default:</h3><ul><li>By default, variables in Rust are <strong>immutable</strong>. Once a value is assigned with let , it can not be changed.</li><li>This default behaviour helps prevent the accidental data modification and makes code easier to reason about.</li></ul><h3>3. Mutability with mut :</h3><ul><li>To allow a variable’d value to change, you must explicitly use the mut keyword:</li></ul><pre><br>let mut variable_name = value;<br></pre><p>Example:</p><pre><br>let mut my_var = 123;<br>my_var = 345;<br></pre><h3>4. Constants wit const :</h3><ul><li>Declared using the const keyword:</li></ul><pre><br>const NAME: Type = value;<br></pre><ul><li><strong>Always immutable</strong>, can not use mut with constants.</li><li>Must have their <strong>type annotated</strong></li><li>Can only be set to a <strong>constant expression</strong> which is computable at compile time.</li><li>Often used for hardcoded values and conventionally named in UPPER_SNAKE_CASE.</li></ul><h3>5. Shadowing:</h3><ul><li>Declaring a <em>new</em> variable with the same name as previous one using let.</li><li>Example:</li></ul><pre><br>let x = 5;<br>let x = x + 1;<br></pre><p>The second x is a new variable shadowing the first.</p><ul><li><strong>Key difference from </strong><strong>mut</strong>: Shadowing creates a <em>new</em> variable, allowing you to change the <em>type</em> of the bound to the name. mut changes the value in place but not the type.</li><li>Useful for transforming a value while reusing the variable name.</li></ul><p>Variables in Rust store data, which can be of various <strong>basic data types</strong> like integers, floats, booleans, and characters ( we will cover this in more details in coming articles).</p><p>Rust’s emphasis on <strong>immutability by default</strong>, combined with option of mut and feature of shadowing, provides fine grained control over data manipulation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcb00cdbbbf7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rust Essentials: How to Set Up Your Development Environment]]></title>
            <link>https://medium.com/@themayurkumbhar/rust-essentials-how-to-set-up-your-development-environment-36d5414e0a3e?source=rss-17f52f3e1b52------2</link>
            <guid isPermaLink="false">https://medium.com/p/36d5414e0a3e</guid>
            <category><![CDATA[getting-started]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[rust-programming-language]]></category>
            <category><![CDATA[hello-world]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Mayur Kumbhar]]></dc:creator>
            <pubDate>Tue, 06 May 2025 16:10:17 GMT</pubDate>
            <atom:updated>2025-09-27T09:05:46.030Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*J0ewlRbW6Bu1TH8ph5ykXg@2x.jpeg" /></figure><p>In the <a href="https://medium.com/@mayur.kumbhar/rust-101-the-fundamentals-a07eba0ffd1f">previous article</a>, we uncovered the power of Rust and explored its fundamental concepts. But theory alone isn’t enough — it’s time to get our hands dirty!</p><p>In this article, we’ll walk you through setting up your local Rust development environment and writing your very first program. Let’s dive in and bring Rust to life on your machine!</p><p>Rust offers an exceptional toolchain manager called rustup to simplify your development experience. Pair it with a reliable code editor or an integrated development environment (IDE) for a seamless and efficient coding journey.</p><p><strong>1. Installing the Rust Toolchain with </strong><strong>rustup</strong></p><ul><li>What is rustup? It’s the official command-line tool for installing and managing Rust versions along with its essential tools, such as rustc, cargo, and documentation. With rustup, keeping your Rust environment up-to-date becomes effortless, ensuring you always have access to the latest features and fixes.</li><li>How to Install Rust:</li></ul><p><strong>Linux/macOS:</strong> Open your terminal and run the following command to install Rust:</p><pre>curl --proto &#39;=https&#39; --tlsv1.2 -sSf https://sh.rustup.rs | sh</pre><p><strong>Windows:</strong> Visit the <a href="https://www.rust-lang.org/tools/install">official Rust website</a> and download rustup-init.exe. Run the installer to set up Rust on your system.</p><ul><li>Post-Installation Steps:</li></ul><p>After installing Rust, it’s essential to ensure that cargo and rustc are properly added to your system&#39;s PATH. If they aren’t, you might need to restart your terminal or execute a source command, such as:</p><pre>source $HOME/.cargo/env</pre><p>(For Linux/macOS users).</p><p><strong>Verification:</strong><br>To confirm a successful installation, open a new terminal and run the following commands:</p><pre>rustc --version<br><br>cargo --version</pre><p>These will display the installed versions of Rust’s compiler and package manager, verifying that everything is set up correctly.</p><p><strong>Key Tools</strong> Installed by rustup:</p><ul><li>rustc: The <strong>Rust compiler</strong> that <strong>transforms your source code</strong> into <strong>executables or libraries</strong>, forming the backbone of Rust development.</li><li>cargo: Rust&#39;s indispensable <strong>build system and package manager</strong>. It <strong>simplifies project creation</strong>, <strong>builds your code</strong>, <strong>manages dependencies</strong> (crates from <a href="https://crates.io/">crates.io</a>), <strong>runs tests</strong>, and much more.</li></ul><p><strong>2. Setting Up Your IDE</strong></p><p>While a plain text editor can get the job done, using an IDE or advanced code editor can supercharge your productivity. With features like syntax highlighting, autocompletion, and real-time error detection, you’ll spend less time debugging and more time building.</p><p>Pair <strong>Visual Studio Code (VS Code)</strong> with the <strong>Rust Analyzer</strong> extension for the ultimate Rust development experience. This powerful combination provides intelligent code assistance, making your workflow smoother and more efficient.</p><p>With rustup installed (giving you rustc and cargo) and your IDE set up with Rust Analyzer, your development environment is ready!</p><p><strong>3. Hello Rust! your first program</strong></p><p>Projects in Rust are managed with cargo, a versatile tool that acts as a package manager, build system, test runner, and documentation generator. We&#39;ll use cargo to create and manage our project.</p><p><strong>Step 1:</strong> Create project with cargo</p><pre>cargo new hello_rust</pre><ul><li>cargo: Runs the Cargo tool, Rust&#39;s package manager and build system.</li><li>new: A subcommand that creates a new Rust project.</li><li>hello_rust: The name of the project. Cargo will create a new directory with this name containing the project files.</li></ul><p>When you run this, cargo will output something like:</p><pre>Created binary (application) `hello_rust` package</pre><p><strong>Step 2:</strong> Explore project structure</p><p>Navigate into the newly created directory:</p><pre>cd hello_rust</pre><p>Now, look at the files and directories inside. You should see:</p><pre>.<br>├── Cargo.toml<br>└── src<br>    └── main.rs</pre><ul><li>Cargo.toml: The manifest file of your project, written in TOML (Tom&#39;s Obvious, Minimal Language). It includes metadata like the project&#39;s name, version, author, and dependencies. We&#39;ll explore this file in detail in the next lesson.</li><li>src/: Directory containing your project&#39;s source code.</li><li>src/main.rs: The crate root file for a binary application. By default, Cargo creates a binary crate (an executable program), and main.rs serves as the entry point for the executable.</li></ul><p><strong>Step 3: Examine the Default Code (</strong><strong>src/main.rs)</strong></p><p>Open the src/main.rs file in your chosen IDE (VS Code or IntelliJ IDEA). You&#39;ll find the following code already written for you by cargo new:</p><pre>fn main() {<br>    println!(&quot;Hello, world!&quot;);<br>}</pre><ul><li>fn: Declares a new function.</li><li>main: The special entry point function for Rust executable programs.</li><li>(): Indicates the main function takes no arguments.</li><li>{}: Encloses the body of the function, where instructions are written.</li><li>println!: A macro (not a function, identified by !) used to print text to the console, followed by a newline.</li><li>&quot;Hello, world!&quot;: A string literal, representing the text to be printed.</li><li>;: Marks the end of a statement in Rust.</li></ul><p><strong>Step 4: Build and Run Your Program</strong></p><p><strong>Building the Project:</strong><br>Make sure you are inside the hello_rust directory in your terminal. Then, run the following command to build your project:</p><pre>cargo build</pre><p>The output will look something like this (details may vary):</p><pre>    Compiling hello_rust v0.1.0 (/path/to/your/project/hello_rust)<br>    Finished dev [unoptimized + debuginfo] target(s) in X.XXs</pre><p><strong>Step 5: Running the project (the easy way):</strong></p><p>The most common way to run your Rust program is using cargo run:</p><pre>cargo run</pre><p>This command is a shortcut. Cargo will first check if your code needs to be rebuilt. If it does, it will compile it. Then, it will execute the compiled program.</p><p>You should see the following output:</p><pre>Finished dev [unoptimized + debuginfo] target(s) in Y.YYs<br>     Running `target/debug/hello_rust`<br>Hello, world!</pre><p>Success! You have written, compiled, and run your first Rust program.</p><blockquote>There’s another useful cargo command: cargo check. This command quickly checks your code for errors without producing an executable</blockquote><p>You’ve successfully learned the basics of creating, building, and running a Rust program using cargo, while exploring the default project structure. You&#39;re now ready to dive deeper into Rust&#39;s powerful features. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36d5414e0a3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rust 101: the fundamentals]]></title>
            <link>https://medium.com/@themayurkumbhar/rust-101-the-fundamentals-a07eba0ffd1f?source=rss-17f52f3e1b52------2</link>
            <guid isPermaLink="false">https://medium.com/p/a07eba0ffd1f</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[low-latency]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[rust]]></category>
            <dc:creator><![CDATA[Mayur Kumbhar]]></dc:creator>
            <pubDate>Mon, 05 May 2025 18:25:05 GMT</pubDate>
            <atom:updated>2025-09-27T08:56:03.925Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*z2vTV8neTVyf_cz9BDLv-g@2x.jpeg" /></figure><p>Hello learner’s, in this article, we will discuss about the Rust language fundamentals. We’ll explore why we need Rust, What it is? And Core philosophy behind the language.</p><blockquote>Rust programming language was started in 2006 as personal project, in 2009 Mozilla sponsored project, in 2015 Rust 1.0 was released.</blockquote><h3>What is rust?</h3><p>Rust is <strong>general purpose, multi-paradigm system programming</strong> Language. It’s designed for<strong> performance critica</strong>l tasks, often handled by languages such as C and C++, used in operating systems, embedded systems, game engines etc. It also offers flexibility for command-line tools, web development and more.</p><p>Essentially, rust achieves this low-level control and performance <strong>without requiring a garbage collector</strong>.</p><h3>Core philosophy of rust</h3><p>Rust is built on key pillars:</p><ol><li><strong>Safety:</strong> Rust <strong>guarantees memory safety</strong> at compile time, eliminating common bugs like <strong>dangling pointers</strong>, <strong>null pointer dereferencing</strong>, and <strong>data races in concurrent code</strong>, which are major causes of crashes and security vulnerabilities in other languages.</li><li><strong>Performance: </strong>Rust compiles code into <strong>highly efficient native code</strong>, comparable in performance to C and C++, while eliminating runtime overhead. Its “<strong>Zero-cost abstraction</strong>” ensures speed without compromising high-level features.</li><li><strong>Concurrency:</strong> Rust’s <strong>ownership system</strong> and <strong>borrow checker</strong> prevent data races at compile time, making concurrent code much more manageable.</li><li><strong>Productivity:</strong> Rust offers good tooling (<strong>cargo</strong>), a helpful compiler with detailed error messages, and a growing tooling ecosystem of libraries (<strong>crates</strong>) to boost productivity, despite its focus on low-level control.</li></ol><h4>Why learn rust?</h4><p>Selecting rust offers significant advantages:</p><ul><li><strong>Reliability</strong>: Rust’s robust safety guarantees that successfully compiled code is remarkably free of common, challenging-to-debug runtime errors related to memory or concurrency.</li><li><strong>Speed</strong>: For performance–sensitive applications, Rust is top choice.</li><li><strong>Safer concurrency</strong>: Build multithreaded applications with confidence, knowing compiler helps prevent dangerous bugs.</li><li><strong>Growing demand</strong>: rust’s adoption is increasing across various domains, creating new opportunities</li><li><strong>Deeper understanding</strong>: Learning Rust provides valuable insights into how computer programs manage resources like memory.</li></ul><h3>Common use-cases:</h3><p>Rust’s journey and its role in the world include:</p><ul><li>Operating systems.</li><li>Web servers and web assembly</li><li>Command line tools</li><li>Databases and distributed systems</li><li>Embedded systems</li><li>Blockchain</li></ul><p>In summary, Rust empowers developers to <strong>construct dependable, efficient, and secure software</strong>, effectively <strong>addressing intricate challenges such as concurrency</strong> directly <strong>through compile-time guarantees</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a07eba0ffd1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>