Notes on using Dotty (Scala 3), SBT, and VS Code together

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.

The “Hello, Scala” paperback is just $10

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

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

Scala: What do “effect” and “effectful” mean in functional programming?

When you get started with functional programming (FP) a common question you’ll have is, “What is an effect in functional programming?” You’ll hear advanced FPers use the words effects and effectful, but it can be hard to find a definition of what these terms mean.

A `printf` format reference page (cheat sheet)

Summary: This page is a printf formatting cheat sheet. I originally created this cheat sheet for my own purposes, and then thought I would share it here.

A great thing about the printf formatting syntax is that the format specifiers you can use are very similar — if not identical — between different languages, including C, C++, Java, Perl, PHP, Ruby, Scala, and others. This means that your printf knowledge is reusable, which is a good thing.

Examples of converting Scala 2 code to Scala 3 with Dotty 0.20

Table of Contents1 - Significant indentation syntax with traits and classes2 - match expressions3 - for loops and if/else (and `do` and `then`)4 - try/catch syntax5 - A couple of braces not removed6 - More Dotty/Scala 3 changes

With the Dotty compiler you can convert Scala 2 code to the new Scala 3 syntax, and with the Dotty 0.20.0-RC1 release on November 4, 2019, I thought I’d see how some of the conversions work. Almost all of the changes shown below have to do with the elimination of curly braces and the use of “significant indentation” syntax, but in one example I also show the then and do keywords.