A next-generation compiler for Scala
(scroll down for more info)
Try Scala 3
There are multiple ways of getting started with Scala 3.
- You can try Scala 3 in your browser with Scastie.
- If you already have sbt installed, you can create a Scala 3 project and sbt will take care of the rest.
- You can install all necessary dependencies with coursier by running
cs setup. You can also run
cs install scala3-compileror
cs install scala3-replto install command-line commands for the compiler and repl, correspondingly.
- You can manually install Scala 3 on your computer.
Install Scala 3
If you are a Mac user, you can install Scala 3 with brew:
brew install lampepfl/brew/dotty
If you are a Linux or Windows user, as a prerequisite you need a JDK 8 or later properly installed on your system. The environment variable
JAVA_HOME should point to your Java installation.
For Windows users, we recommend using the Windows subsystem for linux or some other bash shell like git bash.
Then download the latest release. Optionally add the path of the folder
bin/ to the system environment variable
Now you can compile Scala source code:
To start the REPL, run:
Create a Scala 3 Project
The fastest way to create a new project in Scala 3 is using sbt (1.1.4+).
Create a Scala 3 project:
sbt new lampepfl/dotty.g8
Or a Scala 3 project that cross compiles with Scala 2:
sbt new lampepfl/dotty-cross.g8
For documentation see the Scala 3 Example Project.
Learn more about Scala 3
You can find much more information about Scala 3 in ...