The Garbage Collection Handbook, 2nd Edition

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • swift

    The Swift Programming Language

    That is correct. Like Objective-C the compiler statically removes ARC when it can prove it doesn’t need it (or when you annotate it because where you’re getting it from is manually managing and giving you ownership of the reference). So within a function or cross function with LTO (although it looks like swift doesn’t yet have LTO [1] so I’m not sure about cross-module optimizations).

    > When receiving a return result from such a function or method, ARC releases the value at the end of the full-expression it is contained within, subject to the usual optimizations for local values.

    Quote from [2]. I believe [3] might be the compiler pass.

    There actually is some elision that happens at runtime if you install an autoreleasepool if I recall correctly.

    I did actually work at Apple so that’s where my recollection comes from although it’s been 8 years since then and I didn’t work on the compiler side of things so my memory could be faulty.

    [1] https://github.com/apple/swift/pull/32233

    [2] https://opensource.apple.com/source/lldb/lldb-112/llvm/tools...

    [3] https://llvm.org/doxygen/group__ARCOpt.html

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • garbage-collector

    the code from http://maplant.com/gc.html adapted to work on 64 bit (by samsquire)

    if you need code to understand garbage collection, there is walkthrough of garbage collector and C code at http://maplant.com/gc.html

    I tweaked it to work on amd64 and started adding register scanning based on what eatonphil's discord people told me to do.

    https://github.com/samsquire/garbage-collector

    It's not fit for any purpose but more of a learning exercise.

  • ixy-languages

    A high-speed network driver written in C, Rust, C++, Go, C#, Java, OCaml, Haskell, Swift, Javascript, and Python

    Not really, here it is winning hands down over Swift's ARC implementation.

    https://github.com/ixy-languages/ixy-languages

  • mark-sweep

    A simple mark-sweep garbage collector in C

    Bob Nystrom (of Game Programming Patterns, Crafting Interpreters, and dartfmt fame) also wrote a tutorial[1], of a precise as opposed to a conservative garbage collector.

    Regarding register scanning, Andreas Kling has made (or at least quoted) an amusing observation[2] that your C runtime already has a primitive to dump all callee-save registers onto the stack: setjmp(). So all you have to do to scan registers is to put a jmp_buf onto the stack, setjmp() to it, then scan the stack normally starting from its address.

    [1] https://journal.stuffwithstuff.com/2013/12/08/babys-first-ga...

    [2] https://youtu.be/IzB6iTeo8kk

  • AGC

    Garbage collection for Ada

    There was this project though.

    https://github.com/Roldak/AGC

    The best part is that it's faster than manual management. People will tell you they need do to malloc and free manually for performance, but when you actually run the numbers GC wins for a majority of use cases.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Why isn't there a GCed variant of C++ that'd be functionally like Java, but with C++'s syntax?

    2 projects | /r/AskProgramming | 25 Oct 2022
  • CactusRef: an experimental cycle-aware Rc and mini tracing GC

    1 project | /r/rust | 14 Jun 2021
  • Jank development update – Moving to LLVM IR

    2 projects | news.ycombinator.com | 17 Oct 2024
  • I have written a JVM in Rust

    5 projects | news.ycombinator.com | 21 Jul 2023
  • Ask HN: Best compiler/interpreter books for hacking on Scheme?

    2 projects | news.ycombinator.com | 19 Jul 2023

Did you konow that C++ is
the 6th most popular programming language
based on number of metions?