Eclipse IDE for Scala (2.9 story)

Post on 29-Jan-2018

4.066 views 0 download

Transcript of Eclipse IDE for Scala (2.9 story)

Eclipse IDE for Scalathe 2.9 story

Iulian Dragos1

Credits2

Miles Sabin

Martin Odersky

Hubert Plociniczak

Eugene Vigdorchik

Mirko Stocker

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

3David Bernard

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)

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

• use the full-blown Scala compiler for:

• interactive error highlight, completion, hyperlinking

• turning Scala symbols into Java model elements

6

• Why?

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

• consistency

• Why not?

• SPEED

• (no) support for different Scala versions

7

Presentation Compiler

8

• asynchronous

• interruptible

• targeted

• stop after type-checking

9

10

AskTypeAt

Work Queue

Presentation Compiler Thread

Eclipse Threads

11

Work Queue

Presentation Compiler Thread

Eclipse Threads

12

AskTypeCompletion

...

Work Queue

Presentation Compiler Thread

Eclipse Threads

AskTypeAt

12

AskTypeCompletion

...

Work Queue

Presentation Compiler Thread

Eclipse Threads

AskTypeAt

Result is communicated through a SyncVar

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)

14

Implementation

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

• memory leaks

• side-effects/state

• out-of-order and targeted type-checking

15

• compiler changes needed

• 2.9 compiler has them

• what about 2.8?

• David Bernard ‘backports’

• 2.8.2 preview available now!

16

• Reliability, responsiveness over features

• Create a solid foundation for adding features

17

Goals, again

Versions

• wip_experiment

• feature freeze, focus on getting the basics right

• wip_exp_backports

• backported many patches

• new features (SoC - highlight implicits)

18

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 ?

Roadmap20

• MERGE the two code bases

• add features on the solid 2.x base

21

• 2.0 final release

• SBT-based builder/SBT console

• REPL improvements

• Find References

• better testing

• sketch a Scala tools API

22

• 2.1

• Scala aware debugger

• scalatest/specs integration

• Better refactoring

23

24