eclipse ide for scala (2.9 story)

25
Eclipse IDE for Scala the 2.9 story Iulian Dragos 1

Upload: iulian-dragos

Post on 29-Jan-2018

4.067 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Eclipse IDE for Scala (2.9 story)

Eclipse IDE for Scalathe 2.9 story

Iulian Dragos1

Page 2: Eclipse IDE for Scala (2.9 story)

Credits2

Page 3: Eclipse IDE for Scala (2.9 story)

Miles Sabin

Martin Odersky

Hubert Plociniczak

Eugene Vigdorchik

Mirko Stocker

and many more: Matt Russell, Josh Suereth, Daniel Ratiu, Donna Malayeri..

3David Bernard

Page 4: Eclipse IDE for Scala (2.9 story)

4

Goals

• work with large projects/files

• Scala compiler (80k LOC), 4-5000 LOC/file

• advanced use of the type system

• path-dependent types, self-types, mix-ins

• reliable (no crashes/lock ups)

• responsive (never wait when typing)

Page 5: Eclipse IDE for Scala (2.9 story)

Howto?

5

• mixed team with compiler and IDE expertise

• ScalaSolutions/Typesafe involvement started around September 2010

• Martin, Eugene and Iulian

• branch ‘wip_experiment’ in the scala-ide repo

Page 6: Eclipse IDE for Scala (2.9 story)

• use the full-blown Scala compiler for:

• interactive error highlight, completion, hyperlinking

• turning Scala symbols into Java model elements

6

Page 7: Eclipse IDE for Scala (2.9 story)

• Why?

• reuse (type-checker == 1-2 person years)

• consistency

• Why not?

• SPEED

• (no) support for different Scala versions

7

Page 8: Eclipse IDE for Scala (2.9 story)

Presentation Compiler

8

Page 9: Eclipse IDE for Scala (2.9 story)

• asynchronous

• interruptible

• targeted

• stop after type-checking

9

Page 10: Eclipse IDE for Scala (2.9 story)

10

AskTypeAt

Work Queue

Presentation Compiler Thread

Eclipse Threads

Page 11: Eclipse IDE for Scala (2.9 story)

11

Work Queue

Presentation Compiler Thread

Eclipse Threads

Page 12: Eclipse IDE for Scala (2.9 story)

12

AskTypeCompletion

...

Work Queue

Presentation Compiler Thread

Eclipse Threads

AskTypeAt

Page 13: Eclipse IDE for Scala (2.9 story)

12

AskTypeCompletion

...

Work Queue

Presentation Compiler Thread

Eclipse Threads

AskTypeAt

Result is communicated through a SyncVar

Page 14: Eclipse IDE for Scala (2.9 story)

13

• All compiler activity happens on PC thread

• Background compile loaded files when work queue is empty

• Check work queue when type checker reaches “safe-points” in the AST

• Drop everything when a file is changed (AskReload)

Page 15: Eclipse IDE for Scala (2.9 story)

14

Implementation

Page 16: Eclipse IDE for Scala (2.9 story)

• 1 type-checker run / instance --> 100s of type-check runs / minute

• memory leaks

• side-effects/state

• out-of-order and targeted type-checking

15

Page 17: Eclipse IDE for Scala (2.9 story)

• compiler changes needed

• 2.9 compiler has them

• what about 2.8?

• David Bernard ‘backports’

• 2.8.2 preview available now!

16

Page 18: Eclipse IDE for Scala (2.9 story)

• Reliability, responsiveness over features

• Create a solid foundation for adding features

17

Goals, again

Page 19: Eclipse IDE for Scala (2.9 story)

Versions

• wip_experiment

• feature freeze, focus on getting the basics right

• wip_exp_backports

• backported many patches

• new features (SoC - highlight implicits)

18

Page 20: Eclipse IDE for Scala (2.9 story)

Versioning

19

2.8 2.9

wip_experiment

wip_exp_backport

2.0.0-beta-28 2.0.0-beta-29

1.0.0-milestones ?

Page 21: Eclipse IDE for Scala (2.9 story)

Roadmap20

Page 22: Eclipse IDE for Scala (2.9 story)

• MERGE the two code bases

• add features on the solid 2.x base

21

Page 23: Eclipse IDE for Scala (2.9 story)

• 2.0 final release

• SBT-based builder/SBT console

• REPL improvements

• Find References

• better testing

• sketch a Scala tools API

22

Page 24: Eclipse IDE for Scala (2.9 story)

• 2.1

• Scala aware debugger

• scalatest/specs integration

• Better refactoring

23

Page 25: Eclipse IDE for Scala (2.9 story)

24