Giter VIP home page Giter VIP logo

Comments (3)

Pauan avatar Pauan commented on May 21, 2024 2

I think a ref-counted GC is okay for a first implementation, but the lack of cycle detection is going to bite hard later, so you'll need to switch to a tracing GC (or similar) eventually.

If it stored a shadow stack in the linear memory, it would be possible to access the GC stack roots by using the shadow stack (this technique is already used in other languages compiled to wasm, like C, C++, and Rust).

from grain.

peblair avatar peblair commented on May 21, 2024

Note: for this to really be useful, we're going to need to essentially implement malloc on top of the WASM linear memory space.

from grain.

peblair avatar peblair commented on May 21, 2024

Update on this: the gc branch is now using an asm.js implementation of K&R C's malloc() for its memory allocation . Next on the to-do list is to implement a notion of GC-managed types in the runtime (so we can do the ref counts).

I'm brainstorming an API to try to make this extensible; the gc branch has a ManagedType class checked in, but it's currently unused. Note that, if we opt to have some form of mallocTagged function, this will have an impact on the codegen, but the exact effect is unclear.

from grain.

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.