- Ludwine Probst @nivdul
- Mathieu Chataigner @mchataigner
- Jonathan Winandy @ahoy_jon
- Jean Helou @jeanhelou
What you will need :
- Internet connexion
- Java Development Kit 8 or more recent
- A terminal
- A text editor or a java IDE with scala plugin
- [OPT] Scala
You can launch this handson via
./handson
on linux/machandson.bat
on windows
These scripts launch SBT (scala build tool) in the background preconfigured with custom commands to play the hands-on. The main command is:
> go
This command launch first test and watch file changes. Each time you modify and save a file, it replays current test. As soon as a test succeed, it goes to the next one.
It will pause at the first wrong answer or code whole (__
or ???
) that you will replace by correct values.
All code in src/main is the machinery for this handson. It uses advanced scala concepts: implicit, macro. You should not worry about this code.
One important thing is the anchor
method. It's a custom method we added to the workshop (it's not standard scala library). It will help you debug your program by inspecting the content of some value/code expression.
- Part 1: basic scala concepts
- Part 2: collection manipulation
- Part 3: functional programming
- Part 4: advanced collections
- Part 5: write a small http server
- Part 6: write a small spark job
- Part 7: write a small scalding job
Please read the ScalaDoc. You will find many answers to questions you might have.
Do not hesitate to use the Scala REPL (or Ammonite REPL same but with colors) or Scala worksheet (in your IDE) to try stuff and have real time feedback.
If you installed Scala on your machine, you will be able to compile simple code:
toto.scala:
case class Toto(name: String)
with scalac
$ scalac toto.scala
and then you can inspect what gets generated with javap:
$ javap toto.scala
Compiled from "toto.scala"
public class Toto {
public java.lang.String name();
public Toto(java.lang.String);
}
This handson is a first introduction to scala. There are many libraries available. One good pointer for more functional programming style is Typelevel. It's an open source community of projects focused on pure functional programming in Scala.
Another entry point to other libraries is Awesome Scala