Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8...
Transcript of Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8...
![Page 1: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/1.jpg)
Mirco Dotta <[email protected]> @mircodotta
For Profit & FunScala in Eclipse
EclipseCon 2013, Ludwinsburg
![Page 2: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/2.jpg)
Agenda
• What is Scala?
• Scala PDE
• Scala or Java8?
![Page 3: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/3.jpg)
0
25
50
75
100
20072008
20092010
Region 1 Region 2
What is Scala?
![Page 4: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/4.jpg)
JVM language
![Page 5: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/5.jpg)
Mature
Since 2001
Current Version 2.10
![Page 6: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/6.jpg)
![Page 7: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/7.jpg)
http://www.thoughtworks.com/radar
![Page 8: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/8.jpg)
Lightweight Syntax
FunctionalObject Oriented
Statically Typed
Unifier
![Page 9: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/9.jpg)
Interoperable with Java
Use any Java library
Mixed Scala/Java projects
![Page 10: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/10.jpg)
Let’s see it in action!
![Page 11: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/11.jpg)
Set up in 3 simple steps
Scala Plug-in Development Environment
• Install Scala IDE (http://scala-ide.org)
• Add Scala Library bundle in the dependencies
• Add Scala Nature to your project
![Page 12: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/12.jpg)
Maven support for Scala
Maven, Tycho & Scala
<plugin> <groupId>net.alchim31.maven</groupId> <artifactId>scala-maven-plugin</artifactId> <version>${scala.plugin.version}</version></plugin>
<dependency> <groupId>org.scala-lang</groupId> <artifactId>scala-library</artifactId> <version>${scala.version}</version></dependency>
Scala Library dependency
Scala Mavenplug-in
2.10.3
3.1.5
![Page 13: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/13.jpg)
Why you should profit today.
Scala now or Java 8 tomorrow?
• Java 8 ships in spring 2014
• But when Eclipse API w/ lambdas & default methods?
• Why waiting when you can use Scala today and profit?
• Concise
• Better type safety guarantees than Java.
• Extremely flexible (e.g., easy to write DSLs)
![Page 14: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/14.jpg)
Learning Scala?
• https://www.coursera.org/course/progfun
Books
http://typesafe.com/resources/free-books http://www.artima.com/pins1ed/
![Page 16: Scala in Eclipse - EclipseCon Europe 2019 · Why you should profit today. Scala now or Java 8 tomorrow? • Java 8 ships in spring 2014 • But when Eclipse API w/ lambdas & default](https://reader030.fdocuments.us/reader030/viewer/2022041100/5ed74d72c079a632805806e4/html5/thumbnails/16.jpg)
Links to all resources used in this talk
Resources
• http://www.scala-ide.org/
• https://github.com/dotta/eclipsecon-eu-2013
• https://github.com/dotta/eclipsecon-java-editor
• Based on http://www.vogella.com/articles/EclipseEditors/article.html
• https://github.com/dotta/eclipsecon-scala-editor