Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Casting Metals

Casting Metals

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

Gabriele Petronella

September 21, 2019
Tweet

More Decks by Gabriele Petronella

Other Decks in Programming

Transcript

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

    buildo ▸ Co-organizer of ScalaItaly ▸ Metals contributor
  2. 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
  3. CASTING METALS 2013 - PROJECT KEPLER ▸ aka macros for

    Scala ▸ Landed in Scala 2.10 together with scala.reflect ▸ Authored by Eugene Burmako at EPFL
  4. 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)
  5. 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
  6. 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
  7. 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!
  8. 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
  9. 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
  10. 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?
  11. 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
  12. 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
  13. CASTING METALS DECEMBER 7, 2018 - METALS 0.3.0 ▸ Build

    import ▸ Goto definition ▸ Accurate diagnostics
  14. 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
  15. 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)
  16. CASTING METALS JANUARY 24, 2019 - METALS 0.4.0 ▸ Find

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

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

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

    view ▸ Project explorer ▸ Libraries explorer ▸ Compilation explorer
  20. CASTING METALS SCALA 3 + METALS = ▸ semanticdb-scalac compiler

    can be replaced by TASTY ▸ Dotty presentation compiler is developed with tooling in mind
  21. 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