Slide 1

Slide 1 text

CASTING METALS GABRIELE PETRONELLA

Slide 2

Slide 2 text

CASTING METALS I’M GABRIELE ▸ Co-founder and Software Engineer at buildo ▸ Co-organizer of ScalaItaly ▸ Metals contributor

Slide 3

Slide 3 text

CASTING METALS AGENDA ▸ Pre-Metals age ▸ Metals age ▸ …and beyond? Metals rich code editing for Scala in VS Code Vim Emacs By Ólafur Páll Geirsson https://www.youtube.com/watch?v=MRQMylDxBJ8

Slide 4

Slide 4 text

QUICK SURVEY

Slide 5

Slide 5 text

PRE-METALS AGE

Slide 6

Slide 6 text

CASTING METALS 2013 - PROJECT KEPLER ▸ aka macros for Scala ▸ Landed in Scala 2.10 together with scala.reflect ▸ Authored by Eugene Burmako at EPFL

Slide 7

Slide 7 text

CASTING METALS 2014 - PROJECT PALLADIUM ▸ ok, macros are great… ▸ …but can be also made easier to use? ▸ You may also know Project Palladium as Scalameta (at the time, scala.meta, for assonance with scala.reflect)

Slide 8

Slide 8 text

CASTING METALS 2014 - SCALAMETA ▸ Announced publicly in 2014 at ScalaDays by Eugene Burmako (“Rethinking Scala Macros”) ▸ Intended as a principled foundation for meta programming, intended for use in a new macro system

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

IT DIDN’T Narrator CASTING METALS

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

CASTING METALS 2015 - SCALAMETA SYNTACTIC API ▸ By 2015, Scalameta syntactic API was ready for prime-time ▸ What is the syntactic API? ▸ Parser ▸ Data structures (Trees, Tokens) ▸ Pretty printer

Slide 13

Slide 13 text

CASTING METALS 2016 - SCALAFMT ▸ Code formatter for Scala, based on Scalameta ▸ Developed by Ólafur Páll Geirsson, as his master thesis at EPFL ▸ Presented at Scala Italy 2016, in Venice!

Slide 14

Slide 14 text

CASTING METALS 2016 - SCALAMETA SEMANTIC API ▸ The compiler knows a lot about your code ▸ Scalameta injects itself into the compiler, and it persists information about your code ▸ The information can then be re-used later on by external tools ▸ The data structure holding the information is known as Semanticdb ▸ See the very comprehensive spec https://scalameta.org/docs/semanticdb/ specification.html

Slide 15

Slide 15 text

TYPER BYTECODE SEMANTICDB

Slide 16

Slide 16 text

CASTING METALS 2016 - MIGRATE4S SCALAFIX ▸ The idea: ▸ Scalafmt can fmt your code ▸ Scalafix can fix it ▸ Born in response to the goal of “to define a migration path from Scala 2.x to Dotty”, which came up in the first Scala Center Advisory Board meeting ▸ Authored by Ólafur, who’s at the time was a software engineer at the Scala Center

Slide 17

Slide 17 text

CASTING METALS NOVEMBER 2017 - SCALA.IO ▸ I had just given a presentation about Scalafix ▸ Scalafix can now migrate your code, but also warn about unwanted patterns ▸ It would be neat to have that in your editor! ▸ But how?

Slide 18

Slide 18 text

CASTING METALS IDE IDE FEATURES EDITOR

Slide 19

Slide 19 text

SERVER CASTING METALS CLIENT / SERVER CLIENT FEATURES EDITOR ?

Slide 20

Slide 20 text

SERVER CASTING METALS CLIENT / SERVER CLIENT FEATURES EDITOR LSP

Slide 21

Slide 21 text

CASTING METALS 2016 - LANGUAGE SERVER PROTOCOL ▸ A standardisation effort made by Microsoft, in partnership with RedHat and Codenvy ▸ Created in the context of Visual Studio Code and open sourced on June 27, 2016 ▸ Extensible and “negotiable” ▸ You can implement only part of it, client and server negotiate the supported features ▸ You can extend it with custom features

Slide 22

Slide 22 text

CASTING METALS BACK TO NOVEMBER 2017

Slide 23

Slide 23 text

CASTING METALS BACK TO NOVEMBER 2017

Slide 24

Slide 24 text

METALS AGE

Slide 25

Slide 25 text

CASTING METALS JANUARY 14, 2018 - NAMING IS HARD

Slide 26

Slide 26 text

CASTING METALS 2018 - POC PHASE ▸ Try doing everything! ▸ Entirely based on contributors’ free time ▸ It totally worked! Except for when it didn’t… ▸ “released” as 0.1.0

Slide 27

Slide 27 text

rm -rf v0.1.0 v0.3.0 v0.4.0 v0.5.0 v0.6.0 v0.7.0

Slide 28

Slide 28 text

CASTING METALS DECEMBER 7, 2018 - METALS 0.3.0 ▸ Build import ▸ Goto definition ▸ Accurate diagnostics

Slide 29

Slide 29 text

CASTING METALS 2017 - BLOOP ▸ Build server around Zinc, the Scala incremental compiler ▸ Other build tools can integrate with it ▸ Developed at the Scala Center by Jorge Vicente Cantero (in photo) and Martin Duhem

Slide 30

Slide 30 text

CASTING METALS 2018 - BSP ▸ Equivalent to LSP, but applied to build servers ▸ Joint effort of the Scala Center and the IntelliJ Scala team (Justin Kaeser, in photo)

Slide 31

Slide 31 text

CASTING METALS BSP LSP

Slide 32

Slide 32 text

CASTING METALS JANUARY 24, 2019 - METALS 0.4.0 ▸ Find references ▸ Find symbols in workspace ▸ Symbol outline ▸ Formatting

Slide 33

Slide 33 text

CASTING METALS APRIL 12, 2019 - METALS 0.5.0 ▸ Completions ▸ Hover (aka type at point) ▸ Signature help (aka parameter hints) ▸ Code folding ▸ Document highlights

Slide 34

Slide 34 text

CASTING METALS JUNE 11, 2019 - METALS 0.6.0 ▸ Build import for Maven, Gradle and Mill

Slide 35

Slide 35 text

CASTING METALS JUNE 28, 2019 - METALS 0.7.0 ▸ Tree view ▸ Project explorer ▸ Libraries explorer ▸ Compilation explorer

Slide 36

Slide 36 text

CASTING METALS SOON (LIKELY 0.8.0) ▸ Debugging support ▸ Pants integration ▸ Find implementations

Slide 37

Slide 37 text

…WHAT NOW?

Slide 38

Slide 38 text

CASTING METALS SCALA 3 + METALS = ▸ semanticdb-scalac compiler can be replaced by TASTY ▸ Dotty presentation compiler is developed with tooling in mind

Slide 39

Slide 39 text

I WILL PERSONALLY WORK WITH OTHER PEOPLE ON THE DOTTY TEAM, WITH SCALA CENTER AND WITH VIRTUSLABS TO INTEGRATE METALS WITH TASTY AND THE DOTTY PRESENTATION COMPILER Martin Odersky - September 13, 2019 CASTING METALS

Slide 40

Slide 40 text

GOLDEN AGE OF SCALA TOOLING WE’RE ABOUT TO ENTER THE

Slide 41

Slide 41 text

THANK YOU @GABRO27 METALS.ROCKS WE’RE HIRING! BUILDO.IO/CAREERS