Casting Metals

Casting Metals

A historical perspective on Scala tooling, how Metals came to be and what we can expect for the near future.

C2bb0454c4af1a61e7f173d54ce17b0b?s=128

Gabriele Petronella

September 21, 2019
Tweet

Transcript

  1. CASTING METALS GABRIELE PETRONELLA

  2. CASTING METALS I’M GABRIELE ▸ Co-founder and Software Engineer at

    buildo ▸ Co-organizer of ScalaItaly ▸ Metals contributor
  3. 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
  4. QUICK SURVEY

  5. PRE-METALS AGE

  6. CASTING METALS 2013 - PROJECT KEPLER ▸ aka macros for

    Scala ▸ Landed in Scala 2.10 together with scala.reflect ▸ Authored by Eugene Burmako at EPFL
  7. 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)
  8. 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
  9. None
  10. IT DIDN’T Narrator CASTING METALS

  11. None
  12. 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
  13. 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!
  14. 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
  15. TYPER BYTECODE SEMANTICDB

  16. 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
  17. 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?
  18. CASTING METALS IDE IDE FEATURES EDITOR

  19. SERVER CASTING METALS CLIENT / SERVER CLIENT FEATURES EDITOR ?

  20. SERVER CASTING METALS CLIENT / SERVER CLIENT FEATURES EDITOR LSP

  21. 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
  22. CASTING METALS BACK TO NOVEMBER 2017

  23. CASTING METALS BACK TO NOVEMBER 2017

  24. METALS AGE

  25. CASTING METALS JANUARY 14, 2018 - NAMING IS HARD

  26. 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
  27. rm -rf v0.1.0 v0.3.0 v0.4.0 v0.5.0 v0.6.0 v0.7.0

  28. CASTING METALS DECEMBER 7, 2018 - METALS 0.3.0 ▸ Build

    import ▸ Goto definition ▸ Accurate diagnostics
  29. 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
  30. 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)
  31. CASTING METALS BSP LSP

  32. CASTING METALS JANUARY 24, 2019 - METALS 0.4.0 ▸ Find

    references ▸ Find symbols in workspace ▸ Symbol outline ▸ Formatting
  33. CASTING METALS APRIL 12, 2019 - METALS 0.5.0 ▸ Completions

    ▸ Hover (aka type at point) ▸ Signature help (aka parameter hints) ▸ Code folding ▸ Document highlights
  34. CASTING METALS JUNE 11, 2019 - METALS 0.6.0 ▸ Build

    import for Maven, Gradle and Mill
  35. CASTING METALS JUNE 28, 2019 - METALS 0.7.0 ▸ Tree

    view ▸ Project explorer ▸ Libraries explorer ▸ Compilation explorer
  36. CASTING METALS SOON (LIKELY 0.8.0) ▸ Debugging support ▸ Pants

    integration ▸ Find implementations
  37. …WHAT NOW?

  38. CASTING METALS SCALA 3 + METALS = ▸ semanticdb-scalac compiler

    can be replaced by TASTY ▸ Dotty presentation compiler is developed with tooling in mind
  39. 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
  40. GOLDEN AGE OF SCALA TOOLING WE’RE ABOUT TO ENTER THE

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