What a dotty build looks like?

Reading Time: 3 minutes

Dotty is one of the most awaited change for scala developers. As we know its different then the Scala 2 in many ways. The major goals of this change are as follows:

  1. Making programming language compatible with the dot calculas and use lessons leart from that work.
  2. Making scala easier and safer to use. Remove wart and puzzlers.
  3. Improve consistency and expresiveness of Scala language constructs.

To know more about dotty, here is a beginers guide.

In this blog we will be setting up the local development environement to run dotty application.

While, starting working on dotty, you can start creating a sample project with dotty as I did and created a sample hello world project on my local system. Here in this blog, I am going to share the experience of creating my first dotty project and we will go throgh the findings and what problems I faced one by one with this blog.

Compling build.sbt file sucessfully:

I tried to create a build.sbt with most simple definition of a dotty project.
Here is the sample build.sbt file:

val dottyVersion = "0.24.0-RC1"

lazy val root = project
    name := "my-dotty-sample",
    version := "0.1.0",

    scalaVersion := dottyVersion

This is one of the error you might get during the compilation of project. This is because of the scala version.

To resolve this you need to update the plugins.sbt into project folder with dotty plugin as follows:

addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.1")

This is next error you might get, while compiling the project. This error might be there because of the sbt version. You need to use sbt version >= 1.3.6. Once you update the version if not already updated, this should be resolved.

Here is a link to download/update latest sbt version.


If you accedently compiled the build.sbt before update please update the build.properties file within project folder with latest version.

IDE Support:

The dotty provides support for visual studio. You can download the IDE from here and from the terminal just run the following command to get the IDE for dotty project:

sbt launchIDE

As result the IDE will be open:

Now you are ready to write your first program. Here is a sample main file for “Hello World” program. The file name is HelloWorldApp.scala

object HelloWorldApp extends App {

  println("Hello World!")


Running the application:

To run the application you can follow following steps:

1. Go to the project repo

2. Start SBT

> sbt

3. Run project using run command

sbt:my-dotty-sample> run

Here is the expected output:

Here you can find the sample project on git repo.

Congratulations! You are all set to explore dotty. In our next blog we will be exploring Dotty traits.

Thanks for reading.




Written by 

Girish is a Software Consultant, with experience of more than 3.5 years. He is a scala developer and very passionate about his interest towards Scala Eco-system. He has also done many projects in different languages like Java and Asp.net. He can work in both supervised and unsupervised environment and have a craze for computers whether working or not, he is almost always in front of his laptop's screen. His hobbies include reading books and listening to music. He is self motivated, dedicated and focused towards his work. He believes in developing quality products. He wants to work on different projects and different domains. He is curious to gain knowledge of different domains and try to provide solutions that can utilize resources and improve performance. His personal interests include reading books, video games, cricket and social networking. He has done Masters in Computer Applications from Lal Bahadur Shastri Institute of Management, New Delhi.