Code Monkey home page Code Monkey logo

Comments (1)

vnmakarov avatar vnmakarov commented on August 23, 2024

It is an interesting question. I was asked a few times about this.

One goal of the project is to be simple. Adding GC support would complicate the project. There is no even distinctive pointer type in MIR (it is basically 32- or 64-bit integer).

So to implement GC, you should generate MIR code by yourself to process pointers for GC or to use a conservative GC by scanning the stack and every integer value on the stack in a range of heap addresses to consider a pointer.

I think it is possible to create one additional layer on the top of MIR to deal with pointers for GC but I have no plans to do it by myself as CRuby/MRuby uses conservative GC and I don't need to deal with pointers.

If you don't like conservative GC and would like to use C for code generation, GC implementation would be more difficult as keeping track of pointers will need C extensions for c2m. I am thinking about some extensions for C to implement speculative code generation. I probably will think about implementation C extensions for GC but neither I can promise implementation of it nor moreover I can say when it will be done.

I hope this answers your questions about GC.

from mir.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.