<?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: Gesee-y</title>
    <description>The latest articles on DEV Community by Gesee-y (@geseey).</description>
    <link>https://dev.to/geseey</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%2F2915359%2Fb048d808-f693-44ee-a154-66d0012e1c8b.png</url>
      <title>DEV Community: Gesee-y</title>
      <link>https://dev.to/geseey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/geseey"/>
    <language>en</language>
    <item>
      <title>They lied to you about borrow checking</title>
      <dc:creator>Gesee-y</dc:creator>
      <pubDate>Wed, 29 Jul 2026 16:53:30 +0000</pubDate>
      <link>https://dev.to/geseey/they-lied-to-you-about-borrow-checking-2186</link>
      <guid>https://dev.to/geseey/they-lied-to-you-about-borrow-checking-2186</guid>
      <description>&lt;p&gt;Memory safety has been a huge concern lately, for example roughly &lt;a href="https://www.cisa.gov/news-events/news/urgent-need-memory-safety-software-products" rel="noopener noreferrer"&gt;70% of vulnerabilities in Microsoft are memory issue&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory leaks&lt;/li&gt;
&lt;li&gt;Dangling pointers&lt;/li&gt;
&lt;li&gt;Use after free
and more.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of them have been issue programmers tried to mitigate by all means. They made tools (Valgrind, Address Sanitizer, Tracy, etc), they made conventions, they made patterns and abstraction and ultimately came to one conclusion:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Developers can't be trusted with memory safety, we need a way to enforce safety a make the developer work with it."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This gave birth to &lt;strong&gt;Garbage collection&lt;/strong&gt;, born with &lt;strong&gt;Lisp&lt;/strong&gt;, &lt;strong&gt;Smalltalk&lt;/strong&gt; and popularized by &lt;strong&gt;Java&lt;/strong&gt;.&lt;br&gt;
The pitch was simple: &lt;em&gt;"Build your software without thinking about how memory is managed, we handle that for you."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;No more dangling pointers, no more use after free (you could not more free something yourself), so it seemed like the problem was solved.&lt;/p&gt;

&lt;p&gt;Yet low-level programmer still weren't satified.&lt;/p&gt;
&lt;h2&gt;
  
  
  The failure of GCs
&lt;/h2&gt;

&lt;p&gt;Early garbage collectors had a glaring flaw: they were slow. Back then, reclaiming memory required complex heap scans, object tracing, cycle detection algorithms, and the infamous &lt;strong&gt;stop-the-world&lt;/strong&gt; pauses to guarantee thread safety during collection.&lt;/p&gt;

&lt;p&gt;This is just a small part of the problem but it already sets the tone.&lt;br&gt;
GC was inadapted for performance-critical systems, and low level programmers had to go back into the arms of C/C++.&lt;/p&gt;

&lt;p&gt;Garbage collection has, however, evolved over time, notably with &lt;strong&gt;ARC (Automatic Reference Counting)&lt;/strong&gt; or Nim's &lt;strong&gt;ORC&lt;/strong&gt; (which handle reference cycle) that allows deterministic automatic memory management and do the heavy lifting during compilation.&lt;/p&gt;

&lt;p&gt;But programmers wanted more, as always and decided to go even further. The question was &lt;em&gt;"Can we have memory safety without GC ?"&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Rust
&lt;/h2&gt;

&lt;p&gt;Rust is a programming language introduced in 2015 by Mozilla, and was a shockwave for the software industry.&lt;br&gt;
Reading the description felt like a fever dream: &lt;em&gt;"Memory safety without garbage collection"&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;How on earth did they pull it off ? How can we have memory safety without that GC ? Our program just have embedded cleanup AI within them ?&lt;/p&gt;

&lt;p&gt;Skepticism was rising, the huge hype train left the station, Rust quickly became the most loved, and at times the most polarizing, language in tech.&lt;br&gt;
Yet fundamentally we may just ask &lt;em&gt;"Is this stuff real? Have we touched the graal ?"&lt;/em&gt;&lt;br&gt;
So what's the secret ?&lt;/p&gt;

&lt;p&gt;I see you coming here, ready to spell &lt;strong&gt;B-O-R-R-O-W C-H-E-C-K-I-N-G&lt;/strong&gt;, but the answer is deeper than that and more simple that it seems.&lt;/p&gt;

&lt;p&gt;It's about 3 fundamental concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Affine types&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Move semantics&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Borrow semantics&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Affine type
&lt;/h3&gt;

&lt;p&gt;Affine type is about an object that should be used at most 1 type.&lt;br&gt;
If you have the variable &lt;code&gt;a &amp;lt;- 1&lt;/code&gt; and then you do &lt;code&gt;b &amp;lt;- a&lt;/code&gt;, you used &lt;code&gt;a&lt;/code&gt; and now it's no more possible to use the value it previously had.&lt;/p&gt;

&lt;p&gt;This is the core of the memory safety as it guarantee that each value can only have &lt;strong&gt;one owner&lt;/strong&gt;.&lt;br&gt;
You exactly know when to free an object (exactly when it's used) and you can easily statically ensure a correctness.&lt;br&gt;
This set up the concept of &lt;strong&gt;Ownership&lt;/strong&gt; used in Rust.&lt;/p&gt;

&lt;p&gt;So we have already achieved both &lt;strong&gt;memory safety&lt;/strong&gt; and &lt;strong&gt;thread safety&lt;/strong&gt; (1 owner means one sync point)&lt;/p&gt;

&lt;p&gt;However it's really quite cumbersome to use like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a &amp;lt;- 1
b &amp;lt;- a + 1

some_function(b) # `b` is consumed here
c &amp;lt;- b + 3 # Error: No more `b` exist
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This lead to the introduction of &lt;strong&gt;move semantics&lt;/strong&gt; to make this more usable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Move semantics
&lt;/h3&gt;

&lt;p&gt;Here we redefine what &lt;code&gt;use&lt;/code&gt; means.&lt;br&gt;
We no more consider an object dead after an use but when his owner drop him or die (because of scoping rules).&lt;/p&gt;

&lt;p&gt;Object change owners at each assignment, if we have &lt;code&gt;a &amp;lt;- 1&lt;/code&gt;, &lt;code&gt;b &amp;lt;- a&lt;/code&gt; move the ownership from &lt;code&gt;a&lt;/code&gt; to &lt;code&gt;b&lt;/code&gt; and makes &lt;code&gt;a&lt;/code&gt; undefined but &lt;code&gt;b &amp;lt;- a + 1&lt;/code&gt; doesn't kill &lt;code&gt;a&lt;/code&gt; as it still keeps ownership of it's value.&lt;/p&gt;

&lt;p&gt;But even with that it's still cumbersome:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a &amp;lt;- 1

some_function(a) # Need to modify `a`, so it takes ownership of it and will kill it at the end of the function

a &amp;lt;- a + 1 # Error: No more `a` exist
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's clear that affine types hate being shared!&lt;br&gt;
In order to solve that, Rust introduced his famous &lt;strong&gt;Borrow semantics&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Borrow semantics
&lt;/h3&gt;

&lt;p&gt;Borrow semantics allows you to create references to an object known as &lt;em&gt;borrows&lt;/em&gt;.&lt;br&gt;
So in our previous example you could do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a &amp;lt;- 1

some_function(&amp;amp;mut a) # Need to modify `a`, we lend it a mutable reference to a

a &amp;lt;- a + 1 # `a` still exist!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But as any sharing mecanism (especially with references) it comes with 2 problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lifetimes&lt;/strong&gt;: Making sure the references doesn't outlive the owner.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thread-safety&lt;/strong&gt;: Making sure there is only one sync point, even though there are shared reference. Solved with the mighty rule &lt;strong&gt;aliasing xor mutability&lt;/strong&gt;, multiple immutable ref, only one mutable ref.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those 2 constraints are then ensured by a mechanism known as &lt;strong&gt;Borrow checker&lt;/strong&gt; which make sure that at any points in the program, aliasing rules are respected and &lt;em&gt;lifetimes&lt;/em&gt;... oh lifetimes... this is a whole kind of hell&lt;/p&gt;

&lt;h3&gt;
  
  
  The hell out of lifetimes
&lt;/h3&gt;

&lt;p&gt;Ensuring borrows don't outlive the owner is actually what makes borrow checking hard.&lt;br&gt;
It gives birth to all sorts of absurd situations.&lt;br&gt;
An objects that keeps a references to another object also need to keep it's lifetime to statically know when it's no more alive an avoid dangling pointers&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="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;MyType&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nv"&gt;'a&lt;/span&gt; &lt;span class="nb"&gt;String&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;Types quickly becomes a torrent of static lifetimes annotations as each time you want to share a reference to something, the object that will keep it also need to keep track of the lifetimes&lt;br&gt;
And if your struct aggregates multiple references with different lifetimes, the shortest lifetime restricts the validity of the entire object:&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="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;MyType&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;'b&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;f1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nv"&gt;'a&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;f2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nv"&gt;'b&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// The shortest lifetime dictates how long the whole struct can live&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At times, lifetimes becomes so much of a problem that Rust, the language that promised safety without GC, introduced a &lt;code&gt;Rc&lt;/code&gt; type, which stands for &lt;strong&gt;Reference Counting&lt;/strong&gt; and &lt;code&gt;Arc&lt;/code&gt; (our Automatic Reference Counting mentioned above) which &lt;em&gt;are&lt;/em&gt; GCs, just to allow things to be easily shared.&lt;/p&gt;

&lt;p&gt;And that's not even getting into infamous edge cases, like self-referential or cyclic data structures, which are virtually impossible to express cleanly using standard borrows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rust: The Hype and the Cult
&lt;/h2&gt;

&lt;p&gt;Rust became notoriously famous for its steep learning curve. The internet flooded with articles and videos about "fighting the borrow checker", developers locked in combat with aliasing rules and lifetime annotations.&lt;/p&gt;

&lt;p&gt;To many outsiders, the culture felt almost like a cult. When newcomers complained that &lt;em&gt;fighting the compiler&lt;/em&gt; shouldn't be a normal day-to-day workflow, their frustration was routinely dismissed. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;"You just don't understand the concept."&lt;/em&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;"You need to embrace the borrow checker."&lt;/em&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;"Think of it as a friendly teacher, not an adversary."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Except software engineering isn't kindergarten, and many engineers grew weary of the babysitting.&lt;/p&gt;

&lt;p&gt;Yet, what choice did they have? The core promises were undeniably real:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory safety without (a heavy mandatory) garbage collector&lt;/li&gt;
&lt;li&gt;"Fearless concurrency"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Developers could rage all they wanted, but the hype train had already left the station. Major enterprises began rewriting core systems in Rust: Microsoft, Amazon, Cloudflare, Meta.&lt;/p&gt;

&lt;p&gt;So, &lt;em&gt;embracing the borrow checker&lt;/em&gt; was the right path after all... right?&lt;/p&gt;

&lt;p&gt;As research progressed and the initial euphoria settled, a nagging question emerged: &lt;strong&gt;Was all this complexity actually necessary?&lt;/strong&gt; Was the early skepticism truly just skill issue and stubbornness?&lt;/p&gt;

&lt;p&gt;With time and retrospective insight, the answer turns out to be &lt;strong&gt;no&lt;/strong&gt;. Something really &lt;em&gt;was&lt;/em&gt; off.&lt;br&gt;
And to understand it we need to go back to the root&lt;/p&gt;
&lt;h2&gt;
  
  
  Another path to memory safety
&lt;/h2&gt;

&lt;p&gt;We need to go back to the core.&lt;br&gt;
Remember when I said that affine types were enough to have memory and thread safety but were just cumbersome to use ?&lt;br&gt;
We will go back from that point and take another path, &lt;strong&gt;Mutable Value Semantics&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Mutable Value Semantics
&lt;/h3&gt;

&lt;p&gt;This works a bit like value semantics except that when a variable is assigned to another one, we don't &lt;em&gt;move&lt;/em&gt; it, we &lt;em&gt;copy&lt;/em&gt; it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a &amp;lt;- 1
some_function(a) # `a` is copied and passed to the function, once it's no more used, it's freed

a &amp;lt;- a + 1 # `a` still exist!
b &amp;lt;- a # a is copied into b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we kept the fundamentals of affine types, there is a single owner, and at each assignment or when we need a borrow we make a copy. &lt;code&gt;a&lt;/code&gt; itself is still mutable and can be used at will (the "Mutable" part of it.)&lt;/p&gt;

&lt;p&gt;And here it is. We have achieved memory and thread safety and the framework is usable without need for any lifetimes.&lt;br&gt;
Don't thank me... well you saw the flaw I guess.&lt;/p&gt;

&lt;p&gt;This works but induces a lots of copies in the process and that's where we need another concept to &lt;strong&gt;complete&lt;/strong&gt; it and reduce copies... &lt;strong&gt;borrows&lt;/strong&gt;, but not like Rust's ones.&lt;/p&gt;
&lt;h3&gt;
  
  
  Borrows
&lt;/h3&gt;

&lt;p&gt;Here, borrows aren't to be used for variables but only for &lt;strong&gt;functions&lt;/strong&gt;&lt;br&gt;
When calling a function with some parameters and that function need to modify the value, we temporarily lend it to the function and give it the ability to modify the variable.&lt;br&gt;
The same &lt;/p&gt;

&lt;p&gt;This can fully be specified in the function's definition:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function add_in_place(mut a: int, b: int) {
    a += b
}

a &amp;lt;- 1
b &amp;lt;- 5
add_in_place(a, b) # `a` and `b` are lended to the function, 0 copy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is already a powerful result as data can fully be processed in a functional style without making tons of copies.&lt;br&gt;
This can be even optimized further with &lt;strong&gt;Implicit moves&lt;/strong&gt; by statically analyzing how variables are used and transforming copies into moves&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a &amp;lt;- 1
b &amp;lt;- a # Last use of `a`, it's value is moved into `b`, not copied 
c &amp;lt;- b + 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We may be tempted to stop here, after all we have already greatly reduced copied (not to 0 as Rust does it) and achieved the same safety guarantees, however there are still circumstance where we can't avoid the hard encounters with lifetimes... notably with &lt;strong&gt;slices of data&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Dealing with slices
&lt;/h3&gt;

&lt;p&gt;It may be easy to just say &lt;em&gt;"make a copies"&lt;/em&gt; but that would incur huge performances penalties, so we need to be able to references a part of an object.&lt;br&gt;
In order to solve that specific problem, we indeed need a simple local &lt;strong&gt;borrow checker&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It's work is simple, &lt;em&gt;making sure the variable owning the data doesn't change during the lifetime of the slice nor outlive it&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So will we need complex lifetime to know when the slice will be dropped ?&lt;br&gt;
The answer is no, thanks to MVS.&lt;/p&gt;

&lt;p&gt;When taking a slice to some data by reference, if we try passing that references to another object directly, it will induce a copy of the &lt;strong&gt;slice&lt;/strong&gt;, not the reference to preserve the single owner rule and avoid the annotations&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a &amp;lt;- [0, 1, 2, 3]
b &amp;lt;- &amp;amp;a[0..2] # Taking a ref to slice of an object
c &amp;lt;- b # Not the ref, but the slice is copied, c is now the distinct sequence [0, 1, 2]

a.push(4) # Error: Can't modify `a` while it's borrowed by `b`
b[0] += 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because references cannot be stored into arbitrarily surviving heap objects without triggering a copy or moving into an explicit projection scope, lifetime analysis remains strictly local. This eliminates global lifetime annotations entirely and drastically speeds up compilation times.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sharing Data
&lt;/h3&gt;

&lt;p&gt;The challenge of sharing data isn't fundamentally a borrow checker problem, it’s an inherent constraint of &lt;strong&gt;affine types&lt;/strong&gt;. By stating that a value cannot be used more than once, affine logic inherently prevents a value from residing in multiple locations simultaneously. This makes classic patterns like graphs, doubly-linked lists, or self-referential structures notoriously difficult to express.&lt;/p&gt;

&lt;p&gt;Rust attempted to bridge this gap primarily through complex &lt;strong&gt;borrow semantics&lt;/strong&gt; and lifetime shenaningans.&lt;/p&gt;

&lt;p&gt;For Mutable Value Semantics, we take a far more direct approach: &lt;strong&gt;use a targeted GC for shared data&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of forcing every single allocation into a unified lifetime model, we draw a clear line between &lt;strong&gt;value types&lt;/strong&gt; and &lt;strong&gt;reference types&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Value types&lt;/strong&gt; operate strictly under Mutable Value Semantics (zero lifetimes, local borrows, deterministic cleanup).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reference types&lt;/strong&gt; rely on a lightweight, deterministic collector (such as &lt;strong&gt;ARC&lt;/strong&gt; or Nim’s &lt;strong&gt;ORC&lt;/strong&gt;) to manage shared, cyclic, or graph-like relationships.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Interestingly, Rust ended up doing the exact same thing by providing &lt;code&gt;Rc&lt;/code&gt; and &lt;code&gt;Arc&lt;/code&gt; in its standard library. The difference? Rust tried to solve &lt;em&gt;everything&lt;/em&gt; with borrow semantics first, only to admit that for truly shared graph topologies, compile-time borrow checking simply isn't enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comparison of approach
&lt;/h2&gt;

&lt;p&gt;We make a simple program that returns the longest string between 2 strings:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rust&lt;/strong&gt;&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="k"&gt;fn&lt;/span&gt; &lt;span class="n"&gt;longest&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nv"&gt;'a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nv"&gt;'a&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nv"&gt;'a&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nv"&gt;'a&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="nf"&gt;.len&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="nf"&gt;.len&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;y&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;&lt;strong&gt;MVS&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# x and y are implicit references
function longest(x: string, y: string): &amp;amp;string {
    if x.len() &amp;gt; y.len() { x } else { y } # Will return an implicit ref
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion: The Lie About Borrow Checking
&lt;/h2&gt;

&lt;p&gt;In recent years, Rust was framed as the ultimate pinnacle of memory safety. Even skeptics felt pressured to adopt it, with many coming to believe it was the &lt;em&gt;only&lt;/em&gt; viable path to zero-cost, garbage-collector-free safety.&lt;/p&gt;

&lt;p&gt;The steep learning curve was routinely portrayed as the inevitable price of admission for building reliable software. Enduring the pain of lifetime management became a rite of passage, an initiation required to "elevate one's mind" to the elegance of borrow checking.&lt;/p&gt;

&lt;p&gt;Today, we've seen that this was never the whole truth.&lt;/p&gt;

&lt;p&gt;The friction, the constant fighting with the compiler, the mental gymnastics... these were never user errors. They were warning signs that something was fundamentally off with the language's design.&lt;/p&gt;

&lt;p&gt;Rust is an impressive achievement, but it tried to force every programming paradigm into the strict box of compile-time borrow semantics. In doing so, it introduced immense cognitive overhead for developers.&lt;/p&gt;

&lt;p&gt;If you ever felt frustrated or alienated by Rust, rest assured: you were right all along. It was never a "skill issue." It was a design flaw rebranded as a feature.&lt;/p&gt;

&lt;p&gt;Languages like &lt;strong&gt;Swift&lt;/strong&gt;, &lt;strong&gt;Mojo&lt;/strong&gt;, and &lt;strong&gt;Nim&lt;/strong&gt; are already proving that Mutable Value Semantics can deliver thread safety and high performance without forcing developers to wrestle with global lifetime parameters. &lt;/p&gt;

&lt;p&gt;So the next time someone tells you that &lt;em&gt;"you just don't understand the borrow checker"&lt;/em&gt;, remind them that perhaps they haven't yet explored the alternatives.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
