scala in eclipse - eclipsecon europe 2019 · why you should profit today. scala now or java 8...

16
Mirco Dotta <[email protected] > @mircodotta For Profit & Fun Scala in Eclipse EclipseCon 2013, Ludwinsburg

Upload: others

Post on 30-May-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

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

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

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

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

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

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
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

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

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

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

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

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

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

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

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