{"id":8612,"date":"2022-05-30T15:54:05","date_gmt":"2022-05-30T13:54:05","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=8612"},"modified":"2022-05-30T15:54:07","modified_gmt":"2022-05-30T13:54:07","slug":"eiffel-rust-and-memory-management","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2022\/05\/30\/eiffel-rust-and-memory-management\/","title":{"rendered":"Eiffel, Rust and memory management"},"content":{"rendered":"\n<p>It already passed <s>one year<\/s> almost two years since in &#8220;<a href=\"https:\/\/monodes.com\/predaelli\/2020\/08\/16\/oh-my-lazyness\/\">Oh my lazyness!<\/a>&#8221; when I wrote <\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>I shall restart my efforts on Liberty EIffel and Monodes\u2026 \ud83d\ude41 I hope to integrate them in my current effort.<\/p><\/blockquote>\n\n\n\n<p>While I haven&#8217;t been able to integrate Eiffel in the endeavour that is keeping  me busy until autumn 2022, I haven&#8217;t forgotten it. Actually I&#8217;ve been keeping documenting and studying. One of the many reasons why Eiffel hasn&#8217;t become widespread as I wish is that all Eiffel implementations rely on garbage collection. While most &#8220;modern&#8221; languages relies on GC, for example Python uses  <a href=\"https:\/\/en.wikipedia.org\/wiki\/Reference_counting\">reference counting<\/a> with cycle-detecting  to <a href=\"https:\/\/en.wikipedia.org\/wiki\/Memory_management\">manage memory<\/a>, people tends to think about <a href=\"https:\/\/en.wikipedia.org\/wiki\/Garbage_collection_(computer_science)#Java\">Java<\/a>&#8216;s &#8220;infamous&#8221; reputation for being a memory-hungry language. <\/p>\n\n\n\n<p>Liberty Eiffel uses the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Boehm_garbage_collector\">Boehm garbage collector<\/a>. It works really good, but the idea of letting it handle the memory has always left the Amiga die-hard fan inside me quite disappointed. So when I learned that Rust does not require or even use garbage collecting excites me. See   <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a rel=\"noreferrer noopener\" href=\"https:\/\/deepu.tech\/memory-management-in-rust\/\" target=\"_blank\">\ud83d\ude80 Visualizing memory management in Rust<\/a><\/li><li><a href=\"https:\/\/www.techradiant.com\/2020\/01\/31\/memory-management-rust\/\">Memory Management &amp; Rust<\/a><\/li><\/ul>\n\n\n\n<p>for further informations.<\/p>\n\n\n\n<p>So it seems that first we need to let DISPOSABLE work on expanded classes, or make the collector or the compiler aware of their life-cycle.<\/p>\n\n\n\n<p>As far as I can say, but I can be wrong as it is just a first impression, is that owning an object in Rust is equivalent of having a &#8220;full&#8221; reference in Eiffel, while any borrowed object could be semantically like a <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">class BORROWED&#091;A]\ninherit \n  A\n  WEAK_REFERENCE&#091;A]\nend<\/code><\/pre>\n\n\n\n<p>and having <strong>feature infix &#8220;&amp;&#8221;: BORROWED[like Current]<\/strong> in ANY,  if such a syntax were admissable.<\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">It already passed one year almost two years since in &#8220;Oh my lazyness!&#8221; when I wrote I shall restart my efforts on Liberty EIffel and Monodes\u2026 \ud83d\ude41 I hope to integrate them in my current effort. While I haven&#8217;t been able to integrate Eiffel in the endeavour that is keeping me busy until autumn 2022,&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2022\/05\/30\/eiffel-rust-and-memory-management\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[34,98,321],"tags":[],"class_list":["post-8612","post","type-post","status-publish","format-standard","hentry","category-eiffel","category-liberty-eiffel","category-rust"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-2eU","jetpack-related-posts":[{"id":11120,"url":"https:\/\/monodes.com\/predaelli\/2024\/01\/07\/yet-another-missing-eiffel-%f0%9f%98%a2\/","url_meta":{"origin":8612,"position":0},"title":"Yet another missing Eiffel \ud83d\ude22","author":"Paolo Redaelli","date":"2024-01-07","format":false,"excerpt":"On https:\/\/github.com\/attractivechaos\/plb2 there is yet another programming language benchmark. And yet another not having Eiffel.... In addition to C, there is Nim, V, Rust.... that's very sad \ud83d\ude22","rel":"","context":"In &quot;Eiffel&quot;","block_context":{"text":"Eiffel","link":"https:\/\/monodes.com\/predaelli\/category\/eiffel\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8328,"url":"https:\/\/monodes.com\/predaelli\/2022\/05\/30\/memory-management\/","url_meta":{"origin":8612,"position":1},"title":"Memory management","author":"Paolo Redaelli","date":"2022-05-30","format":false,"excerpt":"https:\/\/www.techradiant.com\/2020\/01\/31\/memory-management-rust\/ https:\/\/deepu.tech\/memory-management-in-rust\/","rel":"","context":"In &quot;Liberty Eiffel&quot;","block_context":{"text":"Liberty Eiffel","link":"https:\/\/monodes.com\/predaelli\/category\/eiffel\/liberty-eiffel\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9687,"url":"https:\/\/monodes.com\/predaelli\/2022\/10\/01\/spacevim-has-eiffel-support\/","url_meta":{"origin":8612,"position":2},"title":"SpaceVim has Eiffel support!","author":"Paolo Redaelli","date":"2022-10-01","format":false,"excerpt":"SpaceVim, a community-driven vim distribution that seeks to provide layer feature, besides turning Vim into a nifty IDE for several languages (C\/C++, Rust, Kotlin, Go, Python, Java and JavaScript plus others), it offers among the available layers one for Eiffel! \u00a0","rel":"","context":"In &quot;Eiffel&quot;","block_context":{"text":"Eiffel","link":"https:\/\/monodes.com\/predaelli\/category\/eiffel\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9332,"url":"https:\/\/monodes.com\/predaelli\/2022\/05\/01\/liberty-liberty-eiffel-programming-language\/","url_meta":{"origin":8612,"position":3},"title":"Liberty | Liberty Eiffel programming language","author":"Paolo Redaelli","date":"2022-05-01","format":false,"excerpt":"Liberty Source: Liberty | Liberty Eiffel programming language","rel":"","context":"In &quot;Liberty Eiffel&quot;","block_context":{"text":"Liberty Eiffel","link":"https:\/\/monodes.com\/predaelli\/category\/eiffel\/liberty-eiffel\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2220,"url":"https:\/\/monodes.com\/predaelli\/2017\/03\/02\/dreaming-of-liberty-eiffel-and-geotechnics\/","url_meta":{"origin":8612,"position":4},"title":"Dreaming of Liberty Eiffel and Geotechnics","author":"Paolo Redaelli","date":"2017-03-02","format":"status","excerpt":"Tonight I made a strange dream. I was taking an exam, It was geotechnical engineering. It was held in a large lecture hall, an amphitheater. For those who have dwelt the Politecnico of Milan, it was T12. This one. It was a written exam. The examiner was not the professor\u2026","rel":"","context":"In &quot;Eiffel&quot;","block_context":{"text":"Eiffel","link":"https:\/\/monodes.com\/predaelli\/category\/eiffel\/"},"img":{"alt_text":"The T12 lecture classroom","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2017\/03\/aula-polimi-t12.jpeg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1490,"url":"https:\/\/monodes.com\/predaelli\/2016\/05\/02\/im-really-doing-it\/","url_meta":{"origin":8612,"position":5},"title":"I&#8217;m really doing it","author":"Paolo Redaelli","date":"2016-05-02","format":false,"excerpt":"Yes, I'm really doing it. Cloning Liberty eiffel repository into a virtual Microsoft Windows instance to help Petroo's effort of porting GNU Liberty Eiffel to Windows, the same day its Desktop Market Share Drops Below 90%","rel":"","context":"In &quot;Fun&quot;","block_context":{"text":"Fun","link":"https:\/\/monodes.com\/predaelli\/category\/fun\/"},"img":{"alt_text":"cloning-liberty","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2016\/05\/cloning-liberty.jpeg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2016\/05\/cloning-liberty.jpeg?resize=350%2C200 1x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2016\/05\/cloning-liberty.jpeg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2016\/05\/cloning-liberty.jpeg?resize=700%2C400 2x"},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/8612","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=8612"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/8612\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=8612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=8612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=8612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}