Fork me on GitHub

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.

Contents

  1. First Steps: Compiling and Running
  2. Parsing
  3. Evaluation, Part 1
  4. Error Checking and Exceptions
  5. TODO
  6. TODO
  7. TODO
  8. TODO
  9. TODO
  10. TODO
  11. TODO
  12. TODO

This tutorial for the Scala programming language is a translation of the excellent Write Yourself a Scheme in 48 Hours tutorial for Haskell.

  1. First Steps: Compiling and Running
  2. Parsing
  3. Evaluation, Part 1
  4. Error Checking and Exceptions
  5. Evaluation, Part 2
  6. ...

Write yourself a Scheme in 48 Hours as well as this tutorial are both licensed under a Creative Commons Attribution-ShareAlike License:

Creative Commons License

The complete code of this website as well as all the source code used in the tutorial are available on GitHub. Feel free to fork and improve them. Have fun!

Mirko Stocker