|
|
|
# Scala
|
|
|
|
Scala stands for "Scalable language". It is concise, low ceremony and has the best of both the object oriented and functional worlds.
|
|
|
|
|
|
|
|
|
|
|
|
The official ["What is Scala?"](http://scala-lang.org/what-is-scala.html) page gives an overview of the language and also contains link to [good resources](http://scala-lang.org/documentation) to dive into Scala.
|
|
|
|
|
|
|
|
For those interested into learning Scala and functional programming simultaneously, the free [Coursera Course](https://www.coursera.org/course/progfun) is highly recommended. Beside giving an excellent introduction, it also explains various design decision behind Scala.
|
|
|
|
|
|
|
|
For those interested in designing their own curriculum, a lot of [good books](http://scala-lang.org/documentation/books.html) are available.
|
|
|
|
|
|
|
|
* [Programming in Scala, 2nd ed.](http://www.artima.com/shop/programming_in_scala_2ed) by Martin Odersky, Lex Spoon, and Bill Venners is co-written by the language's designer. It offers in excellent and in depth knowledge about the language features. But is it long.
|
|
|
|
* For those interested in a faster introduction, [Scala for the Impatient](http://www.horstmann.com/scala/index.html) by Cay S. Horstmann, can be a better starting point.
|
|
|
|
|
|
|
|
If you are a member of FHI, these books and many other books are available for free reading at [Safari books online](http://proquest.tech.safaribooksonline.de)
|
|
|
|
|
|
|
|
However, keep in mind that books get outdated with time and Scala is a rapidly growing language. And these books might not provide you knowledge about features introduced after Scala 2.8.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
Installing Scala is fairly simple. You can either install [sbt](http://www.scala-sbt.org/0.13/docs/index.html) (build tool for scala) or the [scala compiler and interpreter](http://scala-lang.org/download/install.html).
|
|
|
|
If you have checked out [nomad-lab-base](https://gitlab.rzg.mpg.de/nomad-lab/nomad-lab-base) and followed the instructions described in the [Setup file](https://gitlab.rzg.mpg.de/nomad-lab/nomad-lab-base/blob/master/Setup.markdown) then you can use scala interactively with all the libraries used in a given project by writing `project/console` at the sbt prompt that you get executing sbt in the nomad-lab-base directory, for example `base/console` loads basically all libraries and parsers.
|
|
|
|
|
|
|
|
## IDE for Scala
|
|
|
|
|
|
|
|
If you are into IDEs, IntelliJ IDEA with the Scala plugin or the Scala IDE (based on Eclipse) are good for starting with Scala. Scala worksheets (available in both) are very handy to try small piece of code. In IDEA you will have to select "New -> Project from Existing source" to import the project and IDEA should recognize it as a SBT project automatically. Please note that Project SDK should point to java JDK.
|
|
|
|
|
|
|
|
[ensime](http://ensime.github.io/) can give IDE like features to various editors (it started with emacs and was extended to Atom, VS Code, vim and Sublime).
|
|
|
|
You should add
|
|
|
|
|
|
|
|
addSbtPlugin("org.ensime" % "ensime-sbt" % "0.4.0")
|
|
|
|
|
|
|
|
to `~/.sbt/0.13/plugins/plugins.sbt` and then execute `gen-ensime` every time the project imports change at the sbt prompt as described in [ensime sbt setup](http://ensime.github.io/build_tools/sbt/).
|
|
|
|
With emacs after opening a file you can start ensime with `M-x ensime`. You might want to take some setups (or the whole in file) from [.emacs.d/init.el file](emacs-init-file). |
|
|
|
\ No newline at end of file |