These CLI utilities are used to fetch things we need.
We need a JDK, which SDKMAN is used for.
# List available JDKs
sdk ls java
Amazon seems to have a high-quality one.
Version 11 is the last LTS version.
sdk i java 11.0.10.9.1-amzn
sdk i sbt 1.5.0
A system-wide build server that speeds compile times and can watch for changes and automatically recompile.
cs install bloop --only-prebuilt=true
Create a new Scala 3 project using the following template:
sbt new scala/scala3.g8
Change into your project directory and compile and run it using sbt.
sbt compile
sbt run
The following plugins can be added to project/plugins.sbt
to enhance the Scala coding experience.
cs install scalafmt
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") // "2.4.0" is just sbt plugin version
Metals should automatically create a .scalafmt.conf
file in the project root. My settings:
version = "2.7.4"
align.preset = more
maxColumn = 100
| A Scala compiler plugin to give patterns and for-comprehensions the love they deserve.
addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1")
This extension will install everything it needs
Use Bloop to watch for changes and automatically compile and run your program. Your project should have a .bloop
directory that contains a <project>.json
, <project>-test.json
, and a <project>
subdirectory. (Metals in VS Code will create this automatically.) If it doesn't exist, you'll need to use bloop project
to create one.
In one terminal session from within your project's root directory (the one that contains .bloop
), run:
bloop compile -w <project>
From another terminal (same directory), run:
bloop run -w <project>
- Scala 3 Highlights (Dean Wampler)
- Rock the JVM
- Paolo Giarrusso—The DOT Calculus: An Introduction for Scala Programmers