Teaching garbage collection without implementing compiler or interpreters

  • Authors:
  • Gregory H. Cooper;Arjun Guha;Shriram Krishnamurthi;Jay McCarthy;Robert Bruce Findler

  • Affiliations:
  • Google, Inc., Mountain View, CA, USA;Cornell University, Ithaca, NY, USA;Brown University, Providence, RI, USA;Brigham Young University, Provo, UT, USA;Northwestern University, Chicago, IL, USA

  • Venue:
  • Proceeding of the 44th ACM technical symposium on Computer science education
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Given the widespread use of memory-safe languages, students must understand garbage collection well. Following a constructivist philosophy, an effective approach would be to have them implement garbage collectors. Unfortunately, a full implementation depends on substantial knowledge of compilers and runtime systems, which many courses do not cover or cannot assume. This paper presents an instructive approach to teaching GC, where students implement it atop a simplified stack and heap. Our approach eliminates enormous curricular dependencies while preserving the essence of GC algorithms. We take pains to enable testability, comprehensibility, and facilitates debugging. Our approach has been successfully classroom-tested for several years at several institutions.