<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aditya Verma</title>
    <description>The latest articles on DEV Community by Aditya Verma (@aditya_verma_22).</description>
    <link>https://dev.to/aditya_verma_22</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4068717%2F533e4c85-af96-4359-aba2-6d78318ac647.png</url>
      <title>DEV Community: Aditya Verma</title>
      <link>https://dev.to/aditya_verma_22</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aditya_verma_22"/>
    <language>en</language>
    <item>
      <title>Learn Rust with me 🦀</title>
      <dc:creator>Aditya Verma</dc:creator>
      <pubDate>Sat, 08 Aug 2026 11:23:14 +0000</pubDate>
      <link>https://dev.to/aditya_verma_22/learn-rust-with-me-265o</link>
      <guid>https://dev.to/aditya_verma_22/learn-rust-with-me-265o</guid>
      <description>&lt;h2&gt;
  
  
  Why Rust?
&lt;/h2&gt;

&lt;p&gt;Before starting this series and my articles related to Rust I should address why am I even trying to learn and program in Rust. Honestly the first and most important reason is I feel like doing it, that doesn’t mean I do not have a better reason. It’s just a rush of learning something new making mistakes and growing my knowledge and my skillset. Also I feel like the path that I am taking as a software developer has a pretty good spot for Rust. Actually that’s it, I cannot wait to see if Rust can make me fall in love with it or just be another language in my skillset!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note :&lt;/strong&gt; For now I am following the official - The Rust Programming Language book.&lt;/p&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Rust is a multi-purpose system programming language. It is designed for performance, thread safety and memory safety. It provides low level control like C or C++ and provide modern features like many modern programming languages. &lt;/p&gt;

&lt;h3&gt;
  
  
  Rust Compiler : &lt;code&gt;rustc&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Rust uses the &lt;code&gt;rustc&lt;/code&gt; compiler that is written in Rust itself. It directly compiles the code to machine code. So for example if we create a file called &lt;code&gt;hello.rs&lt;/code&gt;  we can directly use the Rust compiler to compile this file and it will provide us with an executable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rustc hello.rs
./hello
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Fun Fact :&lt;/strong&gt; While researching on this topic I got to know that Rust was very much inspired by OCaml and the very first Rust compiler was written in OCaml which then enabled to make a Rust based compiler.&lt;/p&gt;

&lt;h3&gt;
  
  
  First Program
&lt;/h3&gt;

&lt;p&gt;We create a Rust file giving it a file extension of &lt;code&gt;.rs&lt;/code&gt;. In Rust we go by the basic rule of creating a &lt;code&gt;main&lt;/code&gt; function that becomes the entry point for our application. We start by creating a &lt;code&gt;main&lt;/code&gt;  function that will be ran when we run the executable that is created after compiling the file.&lt;br&gt;
For this example we will go the traditional route and create a “Hello, World!” program.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;// hello.rs file.&lt;/span&gt;

&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, World!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above is a simple Rust code to print “Hello, World!” in the terminal. Here we have a simple &lt;code&gt;main&lt;/code&gt;  function which we can define using the keyword &lt;code&gt;fn&lt;/code&gt; . Then inside the &lt;code&gt;main&lt;/code&gt; function we have a &lt;code&gt;println!&lt;/code&gt; . It is a macro according to the official guide book that is still to be explored by me. Basically if we have a &lt;code&gt;!&lt;/code&gt;  after the name it is a macro and if it’s not there it’s a function.&lt;/p&gt;

&lt;p&gt;Now we will see how we can manually compile and run the script like in the above section.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;rustc hello.rs
&lt;span class="nv"&gt;$ &lt;/span&gt;./hello
&lt;span class="nv"&gt;$ &lt;/span&gt;Hello, World!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  CARGO : The level up!
&lt;/h2&gt;

&lt;p&gt;Now since we have seen how can we manually compile a Rust program let’s do one thing, let’s not just use it anytime and start using Cargo! Okay so you see like in every other language we have some sort of a package manager/build system, that’s basically Cargo for Rust. It is a package manager and a build system that is used to download the libraries/dependencies that are needed in our project, build those dependencies, build the project and run it. &lt;/p&gt;

&lt;p&gt;To get started with a project using cargo we will use the &lt;code&gt;cargo new &amp;lt;project_name&amp;gt;&lt;/code&gt;  command. It will create a basic project structure and some configuration files. Let’s first explore the file structure then look at how to actually use cargo properly. When we run the &lt;code&gt;cargo new&lt;/code&gt; command we are presented with this type of file structure :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;- &amp;lt;project_name&amp;gt;/
    - Cargo.toml
    - .gitignore
    - src/
        - main.rs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Okay so here &lt;code&gt;.gitignore&lt;/code&gt;  contains only one thing that is the &lt;code&gt;/target&lt;/code&gt; directory since that is the build directory that we will explore later. &lt;code&gt;.gitignore&lt;/code&gt; is created since Cargo automatically initialises git for us. Next we have the &lt;code&gt;Cargo.toml&lt;/code&gt; file that we can relate to &lt;code&gt;package.json&lt;/code&gt; in JavaScript. It contains the configurations for the project including the package versions and the dependency list. And at the last we have a &lt;code&gt;src/&lt;/code&gt; folder that contains the &lt;code&gt;main.rs&lt;/code&gt; file that will start with when Cargo is used to build the project.&lt;/p&gt;

&lt;p&gt;That is it for this article! We will explore CARGO deeply in the next article. Hope you all have a wonderful day ahead of you.&lt;/p&gt;

&lt;p&gt;-Aditya&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>learning</category>
      <category>programming</category>
      <category>rust</category>
    </item>
  </channel>
</rss>
