<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Demystifying-Ruby on import { Posts } from &#39;blog&#39;;</title>
    <link>https://blog.papey.fr/tags/demystifying-ruby/</link>
    <description>Recent content in Demystifying-Ruby on import { Posts } from &#39;blog&#39;;</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Wed, 23 Apr 2025 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://blog.papey.fr/tags/demystifying-ruby/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Demystifying Ruby ♦️ (3/3): Memory Shenanigans</title>
      <link>https://blog.papey.fr/post/09-ruby-memory/</link>
      <pubDate>Wed, 23 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://blog.papey.fr/post/09-ruby-memory/</guid>
      <description>&lt;p&gt;Garbage collection (&lt;a href=&#34;https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)&#34;&gt;GC&lt;/a&gt;) is an essential process&#xA;in any programming language that manages memory for the programmer. In Ruby (this article is about&#xA;the &lt;a href=&#34;https://en.wikipedia.org/wiki/Ruby_MRI&#34;&gt;MRI&lt;/a&gt;), the garbage collector plays a crucial role in ensuring efficient&#xA;memory usage and preventing memory leaks.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-heap-and-the-stack&#34;&gt;The Heap and the Stack&lt;/h2&gt;&#xA;&lt;p&gt;Memory in a Ruby program is divided into two main regions:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;The Heap&lt;/strong&gt;: This is where dynamically allocated memory lives. Objects created at runtime, such as strings, arrays,&#xA;and hashes, are stored here. The garbage collector primarily operates on the heap to free up unused memory.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;The Stack&lt;/strong&gt;: This is where method calls, local variables, and control flow data are stored. The stack is managed&#xA;automatically and follows a Last In, First Out (LIFO) structure. Each time a method is called, a new stack frame is&#xA;created; when the method completes, its stack frame is removed.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Ruby’s garbage collector is responsible for:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Demystifying Ruby ♦️ (2/3): Objects, Objects everywhere</title>
      <link>https://blog.papey.fr/post/08-ruby-objects/</link>
      <pubDate>Mon, 18 Nov 2024 00:00:00 +0000</pubDate>
      <guid>https://blog.papey.fr/post/08-ruby-objects/</guid>
      <description>&lt;p&gt;One of the most fundamental principles of Ruby is that &lt;strong&gt;everything&lt;/strong&gt; in the language is an object. This object-oriented allows developers to think in terms of objects and their interactions rather than just functions and procedures.&lt;/p&gt;&#xA;&lt;p&gt;In Ruby, every piece of data, whether it’s a number, string, array, or even a class itself, is treated as an object. This means that all these entities can have properties and behaviors, encapsulated within methods and attributes. Let’s explore this !&lt;/p&gt;</description>
    </item>
    <item>
      <title>Demystifying Ruby ♦️ (1/3): It&#39;s all about threads</title>
      <link>https://blog.papey.fr/post/07-demystifying-ruby-01/</link>
      <pubDate>Sun, 20 Oct 2024 00:00:00 +0000</pubDate>
      <guid>https://blog.papey.fr/post/07-demystifying-ruby-01/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://www.ruby-lang.org&#34;&gt;Ruby&lt;/a&gt; is a dynamic, &lt;strong&gt;interpreted&lt;/strong&gt;, open-source programming language known for its simplicity, productivity, and its “human-readable” syntax. Ruby is often used in web development, particularly with the &lt;a href=&#34;https://rubyonrails.org/&#34;&gt;Ruby on Rails&lt;/a&gt; framework. It supports object-oriented, functional, and imperative programming paradigms.&lt;/p&gt;&#xA;&lt;p&gt;The most known and used Ruby Virtual Machine is the &lt;strong&gt;M&lt;/strong&gt;atz &lt;strong&gt;R&lt;/strong&gt;uby &lt;strong&gt;I&lt;/strong&gt;nterpreter (aka CRuby), developed by &lt;a href=&#34;https://en.wikipedia.org/wiki/Yukihiro_Matsumoto&#34;&gt;Yukihiro Matsumoto&lt;/a&gt; (aka Matz), the creator of Ruby. All other Ruby implementation such as &lt;a href=&#34;https://www.jruby.org/&#34;&gt;JRuby&lt;/a&gt;, &lt;a href=&#34;https://github.com/oracle/truffleruby&#34;&gt;TruffleRuby&lt;/a&gt; and so on are out of the scope of this blog post.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
