<?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 Aleezehusman on Medium]]></title>
        <description><![CDATA[Stories by Aleezehusman on Medium]]></description>
        <link>https://medium.com/@aleezehusman2000?source=rss-b995866010ef------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*56XkBDiuep8aDjPB</url>
            <title>Stories by Aleezehusman on Medium</title>
            <link>https://medium.com/@aleezehusman2000?source=rss-b995866010ef------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:57:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aleezehusman2000/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[Getting to know RUST]]></title>
            <link>https://medium.com/@aleezehusman2000/getting-to-know-rust-a13a78cd02cb?source=rss-b995866010ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/a13a78cd02cb</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[rust-programming-language]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Aleezehusman]]></dc:creator>
            <pubDate>Tue, 28 May 2024 10:13:43 GMT</pubDate>
            <atom:updated>2024-05-28T21:50:31.072Z</atom:updated>
            <content:encoded><![CDATA[<p>There has recently been alot of hype around Rust, a fairly new programming language, so I decided to compile a starting point to get familiar with Rust and try it out. In this blog we’ll be looking at what Rust is, what are its main features and we’ll also play around with it a bit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aq62FosR0pMYytSjiWIRPw.png" /></figure><p>Rust isnt as easy to catch on to as some programming languages out there such as Python, so I wouldn’t suggest it for beginners, if you are a beginner I would advice you to get familiar with programming using an easier language and then come to Rust, but still its not impossible to start with Rust either.</p><h3>What is Rust?</h3><p>Lets start off with going over some basic facts about Rust as a programming language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FqqY77y093UKqpeN8whAUw.png" /></figure><ol><li><strong>Statically and strongly typed: </strong>This means it<strong> </strong>doesn’t allow implicit conversions between unrelated types and that types are checked before run time so error will be thrown before the code is even run in case of incorrect types.</li><li><strong>Compiled Language</strong>: This means that it is converted into machine code so that the processor can execute it. The binary executable file can be run on a different machine as well as long as the operating system is the same even if that machine does not have rust installed.</li><li><strong>Extremely Fast and Reliable:</strong> Its very good at error handling and catching bugs. It is also very fast and efficient in terms of execution speed.</li><li><strong>High Level Features with Low Level Control:</strong> Rust does this by providing “zero-cost abstractions”, which means that you can use high-level abstractions without incurring a runtime performance cost. The Rust compiler can optimize the code to the same or similar machine code.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*F4HDeXaAQVEnf41ySDfQ_Q.png" /></figure><p>Rust combines the speed and performance of C++ and safety of Java which makes it a great language for system and embedded programming. There are alot of cool things rust can be used to built such as command line tools, web servers, devops tools, embedded systems, cryptocurrency related systems and so much more! Its also used in part of the Firefox browser. You can dive deeper into what are the features of Rust and who is it for in the official <a href="https://doc.rust-lang.org/book/">Rust book</a>.</p><h3>What makes Rust different?</h3><ol><li><strong>Speed: </strong>Rust pays no penalty for the abstraction and only pays for the features that are actually used. This is because Rust’s abstractions (such as traits, generics, and iterators) are designed to have zero runtime overhead. This means that using these abstractions does not introduce additional performance costs compared to manually written, lower-level code. Furthermore, Rust’s features are modular and optional. This means that you only incur the cost of the features you actually use. For instance, if you don’t use a particular feature or library, it won’t be included in your binary, and you won’t pay for it in terms of performance.</li><li><strong>Safety: </strong>Rust eliminates the need for a Garbage Collector by using a system of ownership and borrowing with rules checked at compile time.<br><em>Ownership</em>: Each value in Rust has a single owner, which is the variable that holds it. When the owner goes out of scope, Rust automatically deallocates the memory for that value. This ensures there are no memory leaks and simplifies memory management.<br><em>Lifetimes</em>: Lifetimes are annotations that tell Rust how long references are valid. The Rust compiler uses lifetimes to ensure references do not outlive the data they point to.<br>By enforcing these rules at compile time, Rust ensures that programs are free of common memory-related bugs such as null pointer dereferencing, dangling pointers, and buffer overflows.<br>Rust’s ownership and borrowing rules<strong> naturally prevent data races</strong>, making concurrent programming safer and easier.</li><li><strong>Cargo Manager: </strong>Rust provides a standard package manager called cargo manager that has all the rust libraries and frameworks however cargo manager is more than just a package manager; it’s an integral part of the Rust development experience. By providing tools for dependency management, project setup, building, testing, documentation, and distribution, Cargo empowers developers to create robust and efficient Rust applications.</li><li><strong>Error Messages: </strong>Rust is known for its user-friendly error messages, which significantly aid developers in debugging and understanding their code. Rust’s error messages are designed to be clear, informative, and helpful. By using color coding, detailed suggestions, and precise location information, Rust makes it easier for developers to quickly identify and fix errors in their code.</li><li><strong>Efficient C Binding: </strong>Rust, despite being a modern language still maintains compatibility with C through FFI i.e Foreign Function Interface (FFI) that allows Rust code to call functions written in C and vice versa. However, by leveraging Rust’s ownership rules, programs that use the FFI to interface with C code can enjoy the benefits of memory safety without sacrificing performance.</li></ol><h3>Get started with RUST on your system</h3><h4>Windows installation</h4><p>Start with installing the <a href="https://www.rust-lang.org/tools/install">graphical installer for Rust</a></p><p>Once its downloaded click on it to start it, it would open a command line prompt as shown:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*sGqG4O-KhSBzlOaMdiryzg.png" /></figure><p>Just enter 1 and press enter for the default installation. <br>Along with that you need to install the<a href="https://visualstudio.microsoft.com/visual-cpp-build-tools/"> Visual Studio C++ Build Tools</a>. When asked which workloads to download make sure ‘C++ Build Tools are selected’, usually Windows 10 SDK is included but if it isnt choose that from individual components as well, along with English from the language pack. Once the installation is complete click launch as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wMkFjsHcrCvBxOiTeBM1qQ.png" /></figure><p>To test if the set up was successful enter <em>rustc </em>to the command prompt and you should be able to see some output as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t-IxibRM8tHN4u3PbGDfqQ.png" /></figure><h4>MacOS installation</h4><p>To install rust on mac run the following command from the <a href="https://www.rust-lang.org/tools/install">official website</a>:</p><pre>curl –proto ‘=https’ –tlsv1.2 -sSf https://sh.rustup.rs | sh</pre><p>Once the installation is complete choose 1 from the menu and press enter, this will download rust with default settings. Then simply enter rustc to see if it has been successfully downloaded, it should give the same response as shown above in the Windows installation.</p><h3>Simple ‘Hello World’ Program</h3><p>Now to get started we’re going to write a hello world program that will help us see how we can run rust code.</p><p>To start off we can use any IDE, I’m using VS Studio. <br>In order to run Rust code we need a main function which is the starting point that the program starts from. Following is a simple program that prints ‘Hello World!’ to the console output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QgUffqdquJurbRCqvdK8_w.png" /></figure><p>The extension for rust files is <em>.rs. </em>Then we will run rustc main.rs to compile the program to an executable. This should create two new files as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*D5-XkWIny1mE3pvaZ8F56g.png" /></figure><p>main.exe is the executable file and it can be run on any windows system without having rust compiler installed.</p><p>Now we can simply run it by .\main.exe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YjfKiRKgOYNTj9QaNiZjHQ.png" /></figure><p>Finally, we just ran our first Rust code!</p><h3>Learning Resources</h3><p>Following are some resources that I used during my learning path and I feel like they have alot of good detailed information for someone starting off:</p><ol><li><a href="https://www.educative.io/courses/learn-rust-from-scratch/printing-styles">https://www.educative.io/courses/learn-rust-from-scratch/printing-styles</a></li><li><a href="https://medium.com/@apicraft/rust-language-pros-cons-and-learning-guide-594e8c9e2b7c">https://medium.com/@apicraft/rust-language-pros-cons-and-learning-guide-594e8c9e2b7</a></li><li><a href="https://www.youtube.com/watch?v=T_KrYLW4jw8&amp;list=PLzMcBGfZo4-nyLTlSRBvo0zjSnCnqjHYQ">https://www.youtube.com/watch?v=T_KrYLW4jw8&amp;list=PLzMcBGfZo4-nyLTlSRBvo0zjSnCnqjHYQ</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a13a78cd02cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>