Tutorials about the Scala programming language.

The PDF of Functional Programming, Simplified is currently on sale for $15 alvin December 12, 2019 - 7:34am

I normally don’t like to have sales on my books, but the short story is that the PDF version of Functional Programming, Simplified is currently on sale for $15.

How to use the Lightbend Config library in a Scala or Java application alvin December 10, 2019 - 11:47am

Table of Contents

  1. Solution
  2. Discussion
Table of Contents1 - Solution2 - Discussion

Scala problem: You want to be able to read configuration files that are written in the Lightbend “Config” file format.

Back to top


Lightbend — initially named Typesafe — created a configuration file format named HOCON, which stands for, “Human-Optimized Config Object Notation.” As an example, a small HOCON configuration file looks like this:

Notes on using Dotty (Scala 3), SBT, and VS Code together alvin December 3, 2019 - 5:28pm

As a note to self, here are some ways to work with Dotty (Scala 3), SBT, and VS Code (Visual Studio Code).

Create a Dotty project:

sbt new lampepfl/dotty.g8

Launch VS Code inside that project directory, with Dotty support:

sbt launchIDE

Start SBT as usual:


Those notes are just a reminder for myself, but hopefully they’ll also help others work with Dotty, SBT, and VS Code.

If Functional Programming, Simplified seems large ... alvin December 2, 2019 - 7:46am

If Functional Programming, Simplified seems large, a) I intentionally wrote it in a simple, leisurely style, and b) it’s a lot easier than reading hundreds of blog posts and all of those books on the right (although a few of those books are really good).

The “Hello, Scala” paperback is just $10 alvin November 29, 2019 - 11:00am

November 29, 2019: A few days ago I made the PDF version of “Hello, Scala” free, and today I made the paperback version of “Hello, Scala” available again, and reduced it’s price from $20 to just $10. Click the image below to buy the book on Amazon.

As I’ve noted before, the contents of this book are being updated and improved, and in the future it will be available as Scala Book. The HTML version of those contents are currently available on the site.

“Hello, Scala” PDF is now free alvin November 26, 2019 - 5:31pm

November 26, 2019: The PDF version of my book “Hello, Scala” is now free, and you can download it by clicking on the image below.

Future “updated and improved” versions of the book are being released as Scala Book. Currently an HTML version of the book is available here on the website, and we’ll have PDF, MOBI, and ePub versions of that available once the creation process is automated and a few other issues are resolved.

But for now, click on the image below if you’d like to download the PDF of Hello, Scala for free:

Hello, Scala PDF

How to read a binary file with Scala (FileInputStream, BufferedInputStream) alvin November 26, 2019 - 3:28pm

As a brief note today, if you need to read a binary file with Scala, here’s an approach I just tested and used. It uses the Java FileInputStream and BufferedInputStream classes:

Dotty (Scala 3) v20 for/do loop syntax alvin November 26, 2019 - 12:35pm

Just fooling around a little bit at the moment, here are several ways to write for/do blocks with the “significant indentation” style in Dotty (Scala 3) as of Dotty v20: