<p><em>Preferred languages</em>: C/C++, Java, and Ruby.</p>

<p>I am looking for some helpful books/tutorials on how to write your own compiler simply for educational purposes. I am most familiar with C/C++, Java, and Ruby, so I prefer resources that involve one of those three, but any good resource is acceptable.</p>

Big List of Resources:
A Nanopass Framework for Compiler Education
¶
Advanced Compiler Design and Implementation
$
An Incremental Approach to Compiler Construction
¶
ANTLR 3.x Video Tutorial
Basics of Compiler Design
Building a Parrot Compiler
Compiler Basics
Compiler Construction
$
Compiler Design and Construction
$
Crafting a Compiler with C
$
Crafting Interpreters
[Compiler Design in C]
12
¶
Compilers: Principles, Techniques, and Tools
$ — aka
"The Dragon Book"
; widely considered "the book" for compiler writing.
Engineering a Compiler
$
Essentials of Programming Languages
Flipcode Article Archive
(look for "Implementing A Scripting Engine by Jan Niestadt")
Game Scripting Mastery
$
How to build a virtual machine from scratch in C#
¶
Implementing Functional Languages
Implementing Programming Languages (with BNFC)
Implementing Programming Languages using C# 4.0
Interpreter pattern
(described in
Design Patterns
$) specifies a way to evaluate sentences in a language
Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages
$
Let's Build a Compiler
by Jack Crenshaw — The
PDF
¶ version (examples are in Pascal, but the information is generally applicable)
Linkers and Loaders
$ (Google Books)
Lisp in Small Pieces (LiSP)
$
LLVM Tutorial
Modern Compiler Implementation in ML
$ — There is a
Java
$ and
C
$ version as well - widely considered a very good book
Object-Oriented Compiler Construction
$
Parsing Techniques - A Practical Guide
Project Oberon
¶ - Look at chapter 13
Programming a Personal Computer
$
Programing Languages: Application and Interpretation
Rabbit: A Compiler for Scheme
¶
Reflections on Trusting Trust
— A quick guide
Roll Your Own Compiler for the .NET framework
— A quick tutorial from MSDN
Structure and Interpretation of Computer Programs
Types and Programming Languages
Want to Write a Compiler?
- a quick guide
Writing a Compiler in Ruby Bottom Up
Compiling a Lisp
— compile directly to x86-64
Legend:
¶ Link to a PDF file
$ Link to a printed book