These CLI utilities are used to fetch things we need.
We need a JDK, which SDKMAN is used for.
# List available JDKs
sdk ls javaAmazon seems to have a high-quality one.
Version 11 is the last LTS version.
sdk i java 11.0.10.9.1-amznsdk i sbt 1.5.0A system-wide build server that speeds compile times and can watch for changes and automatically recompile.
cs install bloop --only-prebuilt=trueCreate a new Scala 3 project using the following template:
sbt new scala/scala3.g8Change into your project directory and compile and run it using sbt.
sbt compile
sbt runThe following plugins can be added to project/plugins.sbt to enhance the Scala coding experience.
cs install scalafmtaddSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") // "2.4.0" is just sbt plugin versionMetals 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