Welcome to Write Yourself a Scheme in Scala
This is a translation to Scala of the tutorial Write Yourself a Scheme in 48 Hours by Jonathan Tang.
Tutorials for programming languages often use the language-reference-manual approach to teaching. They show you the syntax of the language, a few language constructs, and then have you construct a few simple functions at the interactive prompt. The “hard stuff” of how to write a functioning, useful program is left to the end, or sometimes omitted entirely.
This tutorial takes a different tack. You’ll start off with command-line arguments and parsing, and progress to writing a fully-functional Scheme interpreter that implements a good-sized subset of R5RS Scheme. Along the way, you’ll learn …
The main audience targeted by this tutorial is people who already know a programming language of the Java/C# family and want to learn Scala and are also interested in Lisp or Scheme. It might also be interesting for Haskell programmers who know the original tutorial for Haskell and want to see how Scala solves the same problems.
This tutorial will not cover the whole Scala programming language, we specifically avoid all imperative language features and try to stay close to the Haskell original.
Since each lesson builds on the code written for the previous one, it’s probably best to go through the lessons in order.
The source code of this document as well as all the programming examples are available on GitHub.