Over the past 10 days, I read Scala Programming and wrote down Scala code.
As you can see on my GitHub Scala playground, I really like this language - it works as fast as OCaml (thanks to JVM HotSpot technology), protects me from my typos (and errors!) With its strong and static type system, and best of all: humanly, he does not live on a remote "island" (for example, Haskell and OCaml) ... because he has a huge JVM ecosystem.
My only problem:
Despite the fact that I found out how to develop Scala code for VIM using sbt-quickfix or for Emacs with Ensime (and thus have autocomplete and error navigation), so far I have not been able to find a way to debug my code, with the same ease as for Python:
bash$ python -m pdb ./someCode.py
All the posts Google points to basically say, "use this IDE, which I really like ..."
There are reasons, however - it makes no sense to list them, you either know them or donβt know - that people like me prefer (a) programmable editors and (b) a standalone debugger available outside their editor.
If you are one of the few like-minded people who do not like IDEs and use Scala, I would be very interested to know how you are debugging - in fact, I would be interested to hear your entire workflow.
Mine, so far:
- Add
sbt-quickfix
to my SBT project / folder (just see my code in this GitHub repository) - Spawn
sbt
in the terminal and run ~compile
so that it automatically builds when I change something in my sources - VIM automatically receives errors and displays them.
- When the compilation is green, press ENTER on the
sbt
terminal, type run
- etc.
Ensime is even better, allowing also autocomplete:
sbt gen-ensime
- Spawn emacs editing one of my .scala files, and
Mx ensime
- Use
ensime-typecheck-all
(mapped to F7 in my dotfiles) and when everything is ok ... ensime-sbt-do-run
Here, to hope that I am not alone - and someone there will help me with autonomous debugging, too ... the last call before I fully embrace Scala :-)
source share