<?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 Thirumalaivasan Rajasekaran on Medium]]></title>
        <description><![CDATA[Stories by Thirumalaivasan Rajasekaran on Medium]]></description>
        <link>https://medium.com/@raa_thi?source=rss-1f246d91da5a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*U6Gp9ZEkonJNs5Vx.jpg</url>
            <title>Stories by Thirumalaivasan Rajasekaran on Medium</title>
            <link>https://medium.com/@raa_thi?source=rss-1f246d91da5a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 17:26:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@raa_thi/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[Did We Miss the Lesson? What Are We Really Building With All This Tech?]]></title>
            <link>https://medium.com/@raa_thi/did-we-miss-the-lesson-what-are-we-really-building-with-all-this-tech-eec13e3c309d?source=rss-1f246d91da5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/eec13e3c309d</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[research]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[trends]]></category>
            <dc:creator><![CDATA[Thirumalaivasan Rajasekaran]]></dc:creator>
            <pubDate>Fri, 28 Mar 2025 13:29:21 GMT</pubDate>
            <atom:updated>2025-03-28T13:29:21.737Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="The image features bold white text on a black background, asking the question: “Did We Miss the Lesson?” The text is prominently displayed in a large, impactful font. The overall design is minimalistic, with the focus on the central question, meant to provoke thought and reflection." src="https://cdn-images-1.medium.com/max/1024/1*wojRd_gba3hvhR17xi-oNQ.jpeg" /></figure><p>We lived through one of the most disruptive events in modern history — a global pause, a breath held by billions, a silent classroom that tried to teach us something profound.</p><p>COVID-19 exposed everything.</p><p>It showed us our healthcare systems are fragile. Our food supply chains brittle. Our mental health cracked open. It reminded us that <strong>life science</strong>, not entertainment, is what keeps us alive. That <strong>human resilience</strong>, not viral trends, is what truly matters.</p><p>And for a brief moment… it felt like the world might shift.</p><p>Tech giants were shaken. AI researchers turned to protein folding. Open-source ventilators filled GitHub. Scientists and doctors were heroes. The world stared into its own vulnerability — and the tech world had a choice:</p><p><strong>Build to heal. Or build to distract.</strong></p><h3>We Chose the Latter.</h3><p>Instead of rethinking innovation, we sprinted back into old habits:</p><ul><li>More filters.</li><li>More screens.</li><li>More algorithms engineered for attention, not wellbeing.</li></ul><p>Take the latest <strong>Ghibli filter</strong> trending this week. While people are transforming their faces into characters straight out of Studio Ghibli films, it’s the latest example of tech <strong>obsessing over entertainment</strong>, not empowerment. Thousands of people are immersing themselves in an idealized, animated world — one more distraction from the real one.</p><p>FAANG and friends — companies with the power to change how we eat, how we heal, how we age — simply doubled down on dopamine.</p><blockquote>Billions are still being spent to predict what video we’ll scroll to next, while labs trying to understand neurodegenerative diseases scrape by on grants.</blockquote><blockquote>We’re pouring our brightest minds into optimizing entertainment… not saving life.</blockquote><h3>What Could We Have Done Instead?</h3><p>What if this technological renaissance — AI, edge compute, quantum hardware, bioinformatics — was aimed at:</p><ul><li>Early cancer diagnosis using AI</li><li>Real-time air quality monitoring for schools and slums</li><li>AI-assisted farming to feed people with less land, less water, less waste</li><li>Mental health copilots trained not on sentiment, but empathy</li></ul><p>We’ve trained models to <strong>speak</strong>, <strong>paint</strong>, <strong>joke</strong>, <strong>sell</strong>.<br> But have we trained them to <strong>heal</strong>? To <strong>prevent</strong>? To <strong>nourish</strong>?</p><h3>So Now the Question Becomes: What Are We Doing With This Power?</h3><p>We’re generating data at unprecedented speed — a <strong>data tsunami</strong> flooding in from every app, every click, every frame. But for what?</p><ul><li>More distractions?</li><li>More filters?</li><li>More ways to scroll past reality?</li></ul><p>Or will we take this immense compute, this once-in-a-generation AI leap, and turn it <strong>toward life</strong>?</p><h3>This Is Not a Rant. It’s a Reminder.</h3><p>That moment we all shared — that fear, that vulnerability, that hope — it still matters.</p><p>We’re still building the future.<br> We still get to choose where our best minds and best tools go.</p><p>And if you’re reading this — maybe you’re one of the ones who <strong>felt the shift</strong> during COVID.<br> Maybe you’re tired of solving for engagement.<br> Maybe you’re ready to solve for something deeper.</p><p>So here’s the open question:</p><p><strong>Are we going to keep building distractions…<br> or are we finally going to start building for life?</strong></p><p><em>— Crafted by a human, guided by the hand of AI.</em></p><p><em>For more reflections on tech, AI, and life, follow me on </em><a href="https://medium.com/@raa_thi"><em>Medium</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eec13e3c309d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Maven Story]]></title>
            <link>https://medium.com/@raa_thi/a-maven-story-47dc220a53d5?source=rss-1f246d91da5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/47dc220a53d5</guid>
            <category><![CDATA[maven]]></category>
            <category><![CDATA[maven-plugin]]></category>
            <category><![CDATA[java-programming]]></category>
            <category><![CDATA[build-tool]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Thirumalaivasan Rajasekaran]]></dc:creator>
            <pubDate>Thu, 23 Nov 2023 05:01:09 GMT</pubDate>
            <atom:updated>2023-11-23T05:01:09.506Z</atom:updated>
            <content:encoded><![CDATA[<h4>This blog shares my journey of transitioning a large Java project from the Ant build tool to Maven.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*drr8-Du1TuS42FJMwXm3kA.jpeg" /></figure><p>Back with a fresh blog on Maven — no saga, just a simple update on an old project of mine. It’s like catching up with an old buddy and sharing what’s new. In this blog, we’ll dive into the world of Maven, exploring the tweaks and improvements I’ve made to an old favorite. Whether you’re a Maven pro or just getting started, let’s take a stroll through My Maven adventure together!</p><h3>TL;DR</h3><ul><li><strong>The Challenge: </strong>Figuring out how to upgrade an application server in a project with lots of parts using Ant.</li><li><strong>The Solution:</strong> Use Maven’s Multi-Module plan and a Bill Of Materials (BOM) to control versions in one place, making upgrades and managing parts easier.</li><li><strong>The Journey:</strong> Facing issues like circular dependencies and copying projects, Maven’s tools, and multi-module system helped a lot.</li><li><strong>Key Takeaways:</strong> Sharing practical lessons learned during the move, showing how Maven made the project better and ready for more improvements.</li></ul><h3>Once Upon a Time in Engineering</h3><p>In a tech adventure, I have been tasked to upgrade the Application Server for a product used on servers like Glassfish or WebLogic. The goal? Boost security and prepare for future JDK upgrades. The product included 20+ EJB projects and 20+ war projects packed into an EAR.</p><p>These EJB(*-ejb.jar) and WEB (*.war projects) were <a href="https://ant.apache.org/">Ant</a> based Java projects.</p><h3>The Ant Challenge</h3><p>In this world of Ant projects, a big problem arose — figuring out and upgrading application server-related dependencies. The current setup used two projects holding all kinds of dependencies, making it hard to know which project used what. Updating during server upgrades turned into a manual, error-prone task.</p><h3>The Maven Journey</h3><p>To tackle these issues, I aimed to simplify future upgrades and centralize dependency control. Although Ant IVY seemed helpful, I worried about managing dependencies and the messy project structure. Maven and Gradle were options, but <a href="https://dzone.com/articles/building-java-applications-with-maven">Maven</a> gaining the upper hand due to its robust tools and plugins for application servers.</p><p>Taking cues from open-source projects and the structure of Spring projects, the Maven Multi-module with Bill Of Materials (<a href="https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#bill-of-materials-bom-poms">BOM</a>) emerged as a compelling choice.</p><h3>Choosing the Path</h3><p>To make it easier to understand, think of the picture below as the old way we organized projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/0*1cKxIC6_uaR5ILzU.png" /></figure><p>Module_A projects in Ant are compiled into four binaries. However, this contradicts the Maven policy of having <a href="https://stackoverflow.com/questions/2424015/maven-best-practice-for-generating-multiple-jars-with-different-filtered-classes/2426271#2426271">One binary per POM</a> by maintaining a pom.xml for each Ant project.</p><p>Here comes the pivotal question: Could I seamlessly integrate Maven into the existing Ant project structure?</p><h3>Laying New Road</h3><p>The answer lay in creating a parent project with a POM serving as a BOM. This approach offered a refined project structure, aligning with Maven’s directory layout standards.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/0*BanA_DY3lTWMrbMR.png" /></figure><p>The final setup turned into a Maven Multi-Module project, with /Application/pom.xml controlling versions for all modules. The application_ear project wrapped EJB and WAR files into a deployable EAR, while BuildModules made an executable application server zip.</p><p>In this context, /Module_A itself functions as a Maven module with /Application as its parent. Moreover, for each binary of Module_A created in the old project structure, I established a Maven module with /Module_A as the parent. This design mirrors an ideal Maven multi-module project structure for our project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/273/0*SOYVk2-9xy-gmc9f.png" /></figure><ul><li>The *_ejb project compiles EJB classes into module_a_ejb.jar.</li><li>The *_web project assembles WAR classes into module_a_web.war.</li><li>Additionally, *_interface projects bundle Interfaces and DTOs for inter-module dependencies into module_a_interface.jar.</li></ul><p>I’ll delve into the interesting reason behind this *_interface packaging in a later section of this blog.</p><h3>Deep Dive</h3><p>As previously mentioned, I’ve established a primary Maven project called /Application, listing all the subsidiary domain projects beneath it.</p><p>Concerning <strong>version control</strong>, the /Application/pom.xml serves as a Bill-Of-Materials, encompassing dependency and plugin management for centralized control. The XML snippet below showcases version declarations for log4j-1.2-api and Gson.</p><pre>&lt;properties&gt;<br>   &lt;version.log4j.1.2.api&gt;2.19.0&lt;/version.log4j.1.2.api&gt;<br>   &lt;version.gson&gt;2.8.6&lt;/version.gson&gt;<br>&lt;/properties&gt;<br>&lt;dependencyManagement&gt;<br>  &lt;dependency&gt;<br>      &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;<br>      &lt;artifactId&gt;log4j-1.2-api&lt;/artifactId&gt;<br>      &lt;version&gt;${version.log4j.1.2.api}&lt;/version&gt;<br>  &lt;/dependency&gt;<br><br>  &lt;dependency&gt;<br>      &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;<br>      &lt;artifactId&gt;gson&lt;/artifactId&gt;<br>      &lt;version&gt;${version.gson}&lt;/version&gt;<br>  &lt;/dependency&gt;<br>&lt;/dependencyManagement&gt;</pre><p>Consequently, all sub-modules inheriting or using these dependencies are relieved from specifying version information, as demonstrated in the subsequent <a href="https://dzone.com/refcardz/using-xml-java">XML </a>snippet:</p><pre>&lt;dependency&gt;<br> &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;<br> &lt;artifactId&gt;log4j-1.2-api&lt;/artifactId&gt;<br> &lt;scope&gt;compile&lt;/scope&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br> &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;<br> &lt;artifactId&gt;gson&lt;/artifactId&gt;<br> &lt;scope&gt;compile&lt;/scope&gt;<br>&lt;/dependency&gt;</pre><p>Moreover, the concept of <strong>inheritance</strong> plays a role where Maven POMs inherit values from a parent POM. This includes Maven plugins defined at the parent level, providing default implementations for sub-module plugins, as exemplified below:</p><pre>&lt;plugin&gt;<br> &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br> &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;<br> &lt;version&gt;${version.maven.jar.plugin}&lt;/version&gt;<br> &lt;configuration&gt;<br>  &lt;archive&gt;<br>   &lt;index&gt;false&lt;/index&gt;<br>   &lt;manifestEntries&gt;<br>    &lt;Built-By&gt;${user.name}&lt;/Built-By&gt;<br>    &lt;Build-Date&gt;${maven.build.timestamp}&lt;/Build-Date&gt;<br>    &lt;Build-Jdk&gt;${java.vendor}&lt;/Build-Jdk&gt;<br>   &lt;/manifestEntries&gt;<br>   &lt;manifest&gt;<br>    &lt;addClasspath&gt;false&lt;/addClasspath&gt;<br>   &lt;/manifest&gt;<br>  &lt;/archive&gt;<br>  &lt;/configuration&gt;<br>&lt;/plugin&gt;</pre><p>To handle <strong>internal or in-house dependencies</strong>, we’ve established an internal Maven repository akin to JFrog Artifactory within our intranet network. A dedicated repository has been crafted for our product dependencies, and this repository has been integrated for effective dependency resolution.</p><pre>&lt;repositories&gt;<br> &lt;repository&gt;<br>       &lt;name&gt;Internal Dev&lt;/name&gt;<br>       &lt;id&gt;maven-dev&lt;/id&gt;<br>       &lt;url&gt;${maven.dev.repo.url}&lt;/url&gt;<br>       &lt;layout&gt;default&lt;/layout&gt;<br>       &lt;releases&gt;<br>         &lt;updatePolicy&gt;never&lt;/updatePolicy&gt;<br>       &lt;/releases&gt;<br>       &lt;snapshots&gt;<br>         &lt;updatePolicy&gt;always&lt;/updatePolicy&gt;<br>       &lt;/snapshots&gt;<br> &lt;/repository&gt;<br>&lt;/repositories&gt;</pre><p>To ensure uniformity in Java distribution and version during compilation, we’ve encountered instances of unintentional compilation with different<a href="https://dzone.com/articles/java-and-the-jdks-which-one-to-use"> JDK</a> versions in the Ant build model. Addressing this concern, I resolved the issue using the <a href="https://maven.apache.org/enforcer/enforcer-rules/requireJavaVendor.html">maven enforcer plugin</a>, This plugin allows us to<strong> enforce rules </strong>on JDK version and distribution, as illustrated in the example below:</p><pre>&lt;build&gt;<br>    &lt;plugins&gt;<br>      &lt;plugin&gt;<br>        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br>        &lt;artifactId&gt;maven-enforcer-plugin&lt;/artifactId&gt;<br>        &lt;version&gt;${version.maven.enforcer.plugin}&lt;/version&gt;<br>        &lt;executions&gt;<br>          &lt;execution&gt;<br>            &lt;id&gt;enforce-java&lt;/id&gt;<br>            &lt;goals&gt;<br>              &lt;goal&gt;enforce&lt;/goal&gt;<br>            &lt;/goals&gt;<br>            &lt;configuration&gt;<br>              &lt;rules&gt;<br>                &lt;requireJavaVendor&gt;<br>                  &lt;excludes&gt;<br>                    &lt;exclude&gt;${oracle.jdk}&lt;/exclude&gt;<br>                  &lt;/excludes&gt;<br>                  &lt;includes&gt;<br>                    &lt;include&gt;${eclipse.temurin.jdk}&lt;/include&gt;<br>                  &lt;/includes&gt;<br>                &lt;/requireJavaVendor&gt;<br>              &lt;/rules&gt;    <br>            &lt;/configuration&gt;<br>          &lt;/execution&gt;<br>        &lt;/executions&gt;<br>      &lt;/plugin&gt;<br>    &lt;/plugins&gt;<br>  &lt;/build&gt;</pre><h3>Facing Challenges</h3><p>Throughout our smooth migration process, we encountered a few hurdles:</p><p><strong>1. 160+ Project Creation:</strong> With over 40 main modules totaling 160+ projects and submodules, replicating the project structure across all with default configurations and files proved time-consuming. To streamline this, I utilized the Maven project templating kit <a href="https://maven.apache.org/guides/introduction/introduction-to-archetypes.html">Archetype</a>. This tool facilitates the creation of templated project structures, including resource files and default classes for submodules.</p><p><strong>2. Circular Dependencies:</strong> Given the Ant-based nature of the old projects and the absence of a strict component dependency model, circular dependencies emerged as a challenge during project compilation in multiple areas. Maven does not permit circular dependencies. To address this, I introduced *-ejb, *-web, and *-interfaces projects under submodules, segregating Java classes by concern. The INTERFACE projects act as saviors, resolving circular dependencies by holding only DTOs and EJB Interfaces without inter-project dependencies. Other module EJB/WEB projects now reference either their self-module or other modules’ *-interfaces as dependencies.</p><p><strong>3. Distribution Packaging:</strong> Creating a product distribution that bundles *.ear with the application server into a zip file was essential. Since the complete product build script is based on Ant, I decided to employ the <a href="https://maven.apache.org/plugins/maven-assembly-plugin/">maven assembly plugin</a> for packaging the distribution zip file. Initially, I considered placing the assembly scripts in the parent project /Application, assuming that building the parent project would cover all submodules. However, this approach led to inherited assembly behavior across submodules, causing confusion about distribution dependencies and configuration. Despite attempts to restrict inheritance to submodules, the solution proved ineffective.</p><p>Referring to the <a href="https://maven.apache.org/plugins/maven-assembly-plugin/examples/multimodule/module-binary-inclusion-simple.html">assembly plugin guide</a>, I then crafted a distribution project named BuildModules. This project generates the zip file alongside the EAR and application server, with dependencies over the EAR modules, which, in turn, have transitive dependencies over the submodule binaries (*-ejb.jar and *.war).</p><h3>The Grand Finale</h3><p>Despite surpassing the estimated timeline, the project’s ultimate results were commendable. Subsequent minor upgrades to the Application Server were effortlessly accomplished with a mere Maven property change.</p><p>Presently, the <a href="https://dzone.com/articles/owasp-and-its-10-vulnerabilities">OWASP </a>dependency-check-maven conducts more effective scans of dependencies for any known published vulnerabilities. Upgrading the project’s dependencies to align with compatible JDK versions or distributions proved to be a straightforward and uncomplicated process.</p><p>In the end, it’s a well-rounded success story. Moving forward, we’re delving into Maven improvements and developing custom plugins for the product in the next phase.</p><p>Thank you for joining in on this journey. I look forward to sharing more insights in the upcoming blog.</p><p><em>Original Source: If you’re interested, check out the original blog post </em><a href="https://dzone.com/articles/a-maven-story"><em>here</em></a><em>. Excited to share this content on Medium!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47dc220a53d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Comparative Study of the Rust language — A Java Developer’s Perspective : Part 1 -The…]]></title>
            <link>https://medium.com/@raa_thi/the-comparative-study-of-the-rust-language-a-java-developers-perspective-part-1-the-6044ab3b9445?source=rss-1f246d91da5a------2</link>
            <guid isPermaLink="false">https://medium.com/p/6044ab3b9445</guid>
            <category><![CDATA[rust-programming-language]]></category>
            <category><![CDATA[rust-vs-java]]></category>
            <category><![CDATA[rustlang]]></category>
            <category><![CDATA[learn-rust]]></category>
            <dc:creator><![CDATA[Thirumalaivasan Rajasekaran]]></dc:creator>
            <pubDate>Mon, 24 Jan 2022 16:33:15 GMT</pubDate>
            <atom:updated>2022-01-31T17:05:42.329Z</atom:updated>
            <content:encoded><![CDATA[<h3>Learn Rust with Java: Part 1 — The Introduction</h3><p>Hi everyone!!!</p><p>This is my first blog after several attempts of blog writing :). This gonna be a series of blogs to quick learn the <a href="https://www.rust-lang.org/">Rust</a> language. This blog might help Java developers who want to learn the Rust as their next language. This will be a comparative study of the language features and implementation methodologies between the Rust and the Java. But I do recommend the <a href="https://doc.rust-lang.org/book/">Rust Book</a> for better learning.</p><h4>The Super-Hero Introduction ?</h4><p>Here is how the story starts, Java - the language I love most right from my higher education. After 10+ years of development in Java; I started looking for an impressive alternate programming language. I have tried the Python language but it did not work well to me, then considered Go language but it does required runtime and garbage collector like Java. And then I got introduced to the Scala as part of my work project , but I felt it as the language with complicated programming patterns and multi-versed programming methodologies still running on Java Virtual Machine.</p><p>I have special interests in Operating Systems even though I am not a system or kernel programmer. With that I am not impressed with Android OS for its User Interface and privacy issues . But I am a huge fan of Windows Zune themed Metro User Interface of the Windows Phone for its fluidity and user experience. With all that introduction I am writing this blog on Fedora Linux.</p><p>Sometime earlier I got to know that Google is working on a new OS <a href="https://fuchsia.dev/">Fuchsia</a>; In Fuchsia’s Wiki page, I came across a new language(to me actually) in the “written in” section. It is <strong>“Rust”</strong>. When I explored its features, it was like watching a super hero movie trailer, of-course I am a multi-genre movie fan; watched from Star Wars to Martin Scorsese films.</p><p>Its tech time now.</p><h4>Installation &amp; Tool-chain</h4><p>Installation is usual for both languages, the JavaSE installs Java Development Kit and Java Runtime Environment, while in case of Rust the <a href="https://rust-lang.github.io/rustup/">rustup</a> installs the Rust language under /.cargo directory with below set of tools.</p><pre>cargo   cargo-fmt   clippy-driver  rustc   rustfmt   rust-lldb<br>cargo-clippy  cargo-miri  rls  rustdoc  rust-gdb  rustup</pre><p>Here the tool-chain rustup is the one such important tool that Java lacks. For example the JDK update process is not developer friendly, but in Rust the rustup does a lot of things from installation to update and adding additional components.</p><p>To update Rust</p><pre>rustup --update</pre><h4>IDE</h4><p>Every developer loves to work on an IDE, for Java it will be IntelliJ and Eclipse mostly. In case of Rust there is no full featured IDE, one option is VSCode with CodeLLDB debugger or IntelliJ Community Edition without debugger or IntelliJ Ultimate/CLion(I have not explored this option) and multiple text editors.Now Fleet from JetBrains, a VS Code competitor also comes with Rust support.</p><h4>Classes/Files</h4><p>The Java’s Object Oriented Programming Model involves <em>class</em> as the base concept, the Rust language do support Object Orientation but in a different manner, will talk about this later.</p><p>So it is the *.javafile extension in Java and *.rs extension in Rust.</p><h4>Compilation</h4><p>In Java, every class/file is first compiled and then executed using javacand javacommands respectively. In a similar way, Rust files are first compiled with rustc. Once compiled, it turns into LLVM bit code and then further compiled into machine code so it does not need any runtime.</p><p>Due to its compile time evaluation for memory safety and optimization, it will take longer time to compile than Java. So Rust supports two mode of compilation with its build tool cargo(will see in detail when discussing about build tool), the dev mode is non-optimized quicker compilation where as the release mode is optimized slower compilation only done during the release phase of software application.</p><h4>Runtime</h4><p>Java requires its runtime, Java Virtual Machine to be installed in the execution environment. But Rust does not need any runtime.</p><p>Java has a garbage collector, Rust does not need a garbage collector that adds as a great advantage to its improved performance.</p><h4>Build Tool</h4><p>Java does not have a built-in full featured build tool, developers usually prefer open source alternatives like Gradle or Maven. But the Rust is having a powerful built-in build tool cargo, that also acts as a package manager similar to the mvn.</p><p><strong>In Java,</strong></p><p>The library/binary packages of source files are called JAR file with *.jar extension.</p><p>To create a new Java project in maven,</p><pre>mvn archetype:generate -DgroupId=com.tutorial -DaritifactId=hello-world -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false</pre><p>To build a Maven Java Project</p><pre>mvn clean package</pre><p>To run a Maven project</p><pre>mvn clean compile exec:java</pre><p><strong>In Rust,</strong></p><p>The library/binary packages of source files are called crates with *.crate file extension.</p><p>To create a new Rust project in cargo,</p><pre>cargo new hello-world</pre><p>To build and run a Rust project,</p><pre>cargo run</pre><p>To check a Rust project compilation,</p><pre>cargo check</pre><p>To build a Rust project</p><pre>cargo build</pre><p>To build a Rust project for release</p><pre>cargo build --release</pre><h4>Dependency Management</h4><p>In the Maven, the Project Object Model pom.xmlis the source for maven build and dependency management. Similarly in Rust, Cargo.toml is the source file for cargo to build, resolve dependencies and package.</p><p>In maven dependency declaration</p><pre>...<br>&lt;dependencies&gt;<br>      &lt;dependency&gt;<br>         &lt;groupId&gt;group-a&lt;/groupId&gt;<br>         &lt;artifactId&gt;artifact-b&lt;/artifactId&gt;<br>         &lt;version&gt;1.0&lt;/version&gt;<br>         &lt;type&gt;bar&lt;/type&gt;<br>         &lt;scope&gt;runtime&lt;/scope&gt;<br>      &lt;/dependency&gt;<br>  &lt;/dependencies&gt;<br>...</pre><p>In cargo dependency management</p><pre><strong>...<br>[dependencies]</strong> <br>rand = &quot;0.8.0&quot;<br>...</pre><h4>Hello World!</h4><p>In Java,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/84deec31cef2e91cd7a2764ce8a371a8/href">https://medium.com/media/84deec31cef2e91cd7a2764ce8a371a8/href</a></iframe><p>In Rust,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/63913a11c2688dbedbb63485ae5a6500/href">https://medium.com/media/63913a11c2688dbedbb63485ae5a6500/href</a></iframe><p>Rust does not need a class declaration, println!() is not a function it is a macro.</p><h4>Project Structure</h4><p>The Java Maven Project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*EgLEuwcMxOl_ChQ9fbWauw.png" /></figure><p>The Rust Project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*w19tD0zTpDhnGxGoIo8qqw.png" /></figure><p>The main.rs is file with fn main() tells that this project is an application not a library. In case of library project lib.rs file will be there.</p><p>Below is the complete package layout reference from the Cargo book,</p><pre>.<br>├── Cargo.lock<br>├── Cargo.toml<br>├── src/<br>│   ├── lib.rs<br>│   ├── main.rs<br>│   └── bin/<br>│       ├── named-executable.rs<br>│       ├── another-executable.rs<br>│       └── multi-file-executable/<br>│           ├── main.rs<br>│           └── some_module.rs<br>├── benches/<br>│   ├── large-input.rs<br>│   └── multi-file-bench/<br>│       ├── main.rs<br>│       └── bench_module.rs<br>├── examples/<br>│   ├── simple.rs<br>│   └── multi-file-example/<br>│       ├── main.rs<br>│       └── ex_module.rs<br>└── tests/<br>    ├── some-integration-tests.rs<br>    └── multi-file-test/<br>        ├── main.rs<br>        └── test_module.rs</pre><ul><li>Cargo.toml and Cargo.lock are stored in the root of your package (<em>package root</em>).</li><li>Source code goes in the src directory.</li><li>The default library file is src/lib.rs.</li><li>The default executable file is src/main.rs.</li><li>Other executables can be placed in src/bin/.</li><li>Benchmarks go in the benches directory.</li><li>Examples go in the examples directory.</li><li>Integration tests go in the tests directory.</li></ul><p>We will dive deep into the Project structure, Crates and Module(in Java terms package) in later blogs.</p><p>That is all about the introduction to the Rust language. Will see you in the next blog.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6044ab3b9445" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>