Scala Book: Free PDF, Mobi, and ePub versions

Update, May 3, 2020: I added the single-page HTML version of the book to the Downloads section below.

Back in the summer of 2019, a book publisher approached me and asked if they could buy the rights to an “introduction to Scala” book I had independently published and titled, “Hello, Scala.” The book is about 225 pages long and provides a brief-but-thorough introduction to the Scala language.

I came extremely close to signing with that publisher, but as fate would have it, right at that time I saw some people on contributors.scala-lang.org say something to the effect, “If only we had an online book ...”

Had I signed up with that publisher, you’d have to pay $30-40 to read that book, but when I saw that note on the contributors website, I decided to give the book to the Scala Center and scala-lang.org. As a result, we renamed and updated the book — many thanks to Julien Richard-Foy for his many comments and suggestions — and you can find the free HTML version of the book as “Scala Book” online at this scala-lang.org URL.

Downloads: Mobi, ePub, PDF, and HTML versions

In addition to being available in HTML format on docs.scala-lang.org, the book is also freely available in Mobi, ePub, PDF, and single-page HTML formats at the links below. As I get back into working on this project I created a cover for the book. It’s a work-in-progress, and currently looks like this:

Scala Book cover

Notes about the single-page HTML version

The single-page HTML version of the book has these features:

  • The entire book is in one single-page HTML file (named ScalaBook.html)
  • It has source code syntax highlighting
    • The syntax highlighting comes from Prism
    • If you want to work with Prism, you can adjust the syntax highlighting as desired
  • You can adjust all of the CSS as desired
  • I currently use jQuery to put numbers on the chapters; I’ll replace that in a future release, it was just the easiest way to add that feature this weekend

Download links

Here are the links to the PDF, Mobi, ePub, and single-page HTML versions of the book:

If you know anyone who wants to learn Scala for free, I hope this book will be useful for them.

Updates

This summer I’ll start working on updating the book to cover Scala 3. I’ll make announcements about updates here on this website and also on my Twitter account.

Contribute to the book

If you’d like to contribute to the book’s content, you’ll find the source code in this project:

The book content is in the _overviews/scala-book directory.

If you have suggestions for the book but don’t want to get quite that involved, you can also contact me on Twitter with your suggestions.