Ruby Hacking Guide

The RHG is a book that explains how the ruby 1.7.x-1.8.x interpreter (the official C implementation of the Ruby language) works internally. The original book was based on the source code of ruby 1.7.3 so there are a few small differences to the current version of ruby. However, these differences may make the source code simpler to understand and the Ruby Hacking Guide is a good starting point before looking into the ruby source code. The version of the source code used can be downloaded here:

This project is picking up from where Vincent Isambart and Clifford Escobar have left off [1], with the aim to translate the outstanding chapters to English to help Ruby hackers understand the internals of the MRI interpreter.

Note also the existence of this translation:

Table of Contents

  • Preface
  • Introduction

Part 1: Objects

  • Chapter 1: Ruby language minimum
  • Chapter 2: Objects
  • Chapter 3: Names and name tables
  • Chapter 4: Classes and modules
  • Chapter 5: Garbage collection
  • Chapter 6: Variables and constants
  • Chapter 7: Security

Part 2: Syntax analysis

  • Chapter 8: Ruby language details
  • Chapter 9: Yacc crash course
  • Chapter 10: Parser
  • Chapter 11: Context-dependent scanner
  • Chapter 12: Syntax tree construction

Part 3: Evaluation

  • Chapter 13: Structure of the evaluator
  • Chapter 14: Context
  • Chapter 15: Methods
  • Chapter 16: Blocks
  • Chapter 17: Dynamic evaluation

Part 4: Around the evaluator

Last modified on 17 January 2011, at 14:31