I’ve started working through “Programming in Scala,” and found that setting up my Scala environment isn’t as straightforward an exercise as I thought it’d be. Chapter 2 of the book, where the tutorial really starts, points the reader to the Scala download page and tells them to follow the instructions there. I’ve found, though, that installing Scala through SBT leads to issues with the code in the book running as written (scripts don’t run as written and I can’t start the Scala REPL with
$ scala). I expect that I’ll find the same thing installing through an IDE (IntelliJ or VS Code).
On the other hand, installing Scala through SDKMAN works; everything runs as written in the book. But now I have a system-wide Scala installation (as opposed to local), and I still don’t know how to pull down additional libraries/modules/etc. This whole exercise has led me to wonder whether there’s a “best practices” or “most common” or “recommended” tooling environment. I come from a Python-centric world where
pipenv install (plus a Pipfile) and
pipenv shell are useful and easily understandable tools. And in my brief time in the Rust world, I appreciated
cargo which like pipenv allows for local installations/configurations.
Is SBT anything like pipenv or cargo? What’s the “recommended” way to set up one’s Scala environment?
If it’s important, I’m working in an Ubuntu 20.04 WSL2 installation. I’m very comfortable with the command line (iPython), similarly comfortable in a browser (Jupyter), and less comfortable with a full IDE (though I’ve set up X11 forwarding).
PS - looks like the Scala 2.13.5 REPL does some nice things with multi-line editing, reverse search [Ctrl-R], and tab completion.