Eiffel, Rust and memory management

It already passed one year almost two years since in “Oh my lazyness!” when I wrote

I shall restart my efforts on Liberty EIffel and Monodes… 🙁 I hope to integrate them in my current effort.

While I haven’t been able to integrate Eiffel in the endeavour that is keeping me busy until autumn 2022, I haven’t forgotten it. Actually I’ve been keeping documenting and studying. One of the many reasons why Eiffel hasn’t become widespread as I wish is that all Eiffel implementations rely on garbage collection. While most “modern” languages relies on GC, for example Python uses reference counting with cycle-detecting to manage memory, people tends to think about Java‘s “infamous” reputation for being a memory-hungry language.

Liberty Eiffel uses the Boehm garbage collector. 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

for further informations.

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.

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 “full” reference in Eiffel, while any borrowed object could be semantically like a

class BORROWED[A]
inherit 
  A
  WEAK_REFERENCE[A]
end

and having feature infix “&”: BORROWED[like Current] in ANY, if such a syntax were admissable.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.