Scala Rosetta Stone
This page is aimed to help developers coming from another language to understand to project structure and tools for Scala.
It's currently a work in progress, and portions are incomplete. Contributions
are welcome if you want to add some helpful tips about $LANGUAGE => Scala
.
Build Tools
Scala is a compiled language, and we will talk about three build tools:
sbt
mill
scala-cli
In Scala, the build tool typically manages your project dependencies.
IDEs
There are generally three big options for writing Scala, where actionable feedback from a compiler is given:
- IntelliJ Idea
- VS Code
- vim/emacs/other text editor
IntelliJ has a wide offering of IDEs for many languages. If you use one of their other ones, then Idea (Community Edition) would likely be a great choice for you.
If you are already familiar with VSCode, then it is a great option for Scala as well! This editor via lsp with the metals plugin.
If you use vim/emacs/other, then you probably want to follow along with the info about VSCode and metals.
Coming from NodeJS
This section tries to help map concepts from NodeJs/Typescript projects to Scala.
SBT
build.sbt
is likepackage.json
: You dependencies are declared here, along with some runnable scripts/tasks, and project information/automation.~/.ivy2
and~/.m2
are likenode_modules
. In Scala/Java, dependencies are globally cached in these directories.<root>/src/main/scala
might be like<root>/src
, where the top-level-directory of your source code files are located.- Scala doesn't really have a
yarn
ornpm
, as it will be handled viasbt