Make sure that you are using macOS or Linux (or WSL on Windows) with Java 8 or newer. You can determine which version of the JDK is the default by typing
java -version in a Terminal window.
Start by cloning the repository:
$ git clone https://github.com/lampepfl/dotty.git $ cd dotty $ sbt managedSources # Needed for IDE import to succeed
Dotty provides a standard sbt build: compiling, running and starting a repl can all be done from within sbt:
$ sbt > scalac tests/pos/HelloWorld.scala > scala HelloWorld hello world
There are also bash scripts that can be used in the same way. Assuming that you have cloned the Dotty repo locally, append the following line on your
$ export PATH=$HOME/dotty/bin:$PATH
and you will be able to run the corresponding commands directly from your console:
# Compile code using Dotty $ scalac tests/pos/HelloWorld.scala # Run it with the proper classpath $ scala HelloWorld
$ sbt > repl Welcome to Scala.next (pre-alpha) (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_101). Type in expressions to have them evaluated. Type :help for more information. scala>
or via bash:
To test our cloned compiler on local projects:
$ sbt publishLocal
Then in the
build.sbt file of a test project:
ThisBuild / scalaVersion := "<dotty-version>-bin-SNAPSHOT"
dotty-version can be found in the file
To generate this page and other static page docs, run
$ sbt > genDocs
Before contributing to Dotty, we invite you to consult the Dotty Developer Guidelines.