project

How to create a Scala 3 (Dotty) project with SBT

I can never remember how to create a Scala 3 (Dotty) project with SBT (in early 2019), so:

# create a new Dotty project
sbt new lampepfl/dotty.g8

# create a dotty project that cross compiles with scala 2
sbt new lampepfl/dotty-cross.g8

# start a dotty reply from within your sbt project
$ sbt

> console
scala> _

Here’s what an example interaction looks like — include SBT renaming my directory name to all lowercase, which brings me no joy:

The Scala community build project

Scala community build is an interesting project, which is described like this:

“This repository contains configuration files that enable us to build and test a corpus of Scala open source projects together using Lightbend's `dbuild`. How big is it? It’s 3.2 million lines of Scala code, total, from 185 projects (as of January, 2019), and takes about 15 hours to run.”

“Why do this? The main goal is to guard against regressions in new versions of Scala (language, standard library, and modules). It’s also a service to the open source community, providing early notice of issues and incompatibilities.”

“Kotlin Quick Reference” book

Table of Contents1 - Kotlin Quick Reference2 - It’s free3 - It’s open source4 - A caveat5 - Contributing6 - The Kindle version7 - Downloads

Somewhere in mid-2017 I started working on a Kotlin programming book, but then I had to get away from it to work on other things. When I got back to it recently I looked around and felt like the world didn’t need another “Introduction to Kotlin” book — there are a couple of good ones out there, including Kotlin in Action, and the kotlinlang.org documentation is excellent — so I decided to ditch the project completely.

Back to top

Kotlin Quick Reference

But then when I started writing some Kotlin code again I realized that what I really needed was a quick reference. I didn’t want to have to dig through a tutorial book or website to find what I need, I just wanted something like a large cheat sheet where I could quickly find the Kotlin syntax and examples for whatever I was working on at that moment. So I decided to strip down what I had already written and create both a book and a Kotlin Quick Reference website.

Pulled a Steve Jobs and canceled my own project

I’ve been working on a Kotlin book on and off for the past few months, and this morning I pulled a Steve Jobs on myself and canceled the project, even though it’s about 75% complete (by chapter count).

The problem with the book is that at this point it doesn’t contain anything unique, although arguably my way of explaining things might be better than other approaches. Unlike the Scala Cookbook, which provides solutions to common Scala problems, and Functional Programming, Simplified, which provides a unique approach to explaining functional programming in Scala, I don’t feel like there’s anything new here.

So, in short, without getting into the details of what’s next, the “vision guy” part of me decided that there are better things to do with my time. (And if you’ve ever been on a project that was canceled and you thought it was hard to take, imagine canceling your own project.)

“They’ve got the keys to the car and they can drive it”

Several years ago I stepped away from a consulting gig. I had an opportunity to continue the gig, but I didn’t enjoy it, and didn’t like the direction the project was headed in. This quote from this article about the Denver Post expresses how I feel very well:

“I have total disagreement with how they're managing the place, but I'm not going to stand up and be overly critical of them. They've got the keys to the car and they can drive it any way they want to. But they're not driving it in a way that I want to be a passenger of the car.”

(That reminds me of the old Alaska sled dog saying: “If you’re not the lead dog, the view never changes.”)