The Garbage Collection Handbook, 2nd Edition

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

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • 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

  • 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.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • 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.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
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