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

Exploring the Scala's Tooling Ecosystem

Exploring the Scala's Tooling Ecosystem

Jeferson David Ossa

June 14, 2019
Tweet

More Decks by Jeferson David Ossa

Other Decks in Technology

Transcript

  1. Exploring the Scala's
    Tooling Ecosystem

    View full-size slide

  2. Q&C
    sli.do
    #tooling

    View full-size slide

  3. What are tools used for?
    Editing, compiling and testing.

    View full-size slide

  4. What are tools used for?
    Editing, compiling and testing, ...
    learning, experimenting, analysing, reviewing code,
    debugging, dependency management, publishing, versioning,
    benchmarking, creating other tools, ...
    coffee, ...

    View full-size slide

  5. Why do we care ?

    View full-size slide

  6. Why do we care ?
    Productivity.

    View full-size slide

  7. LSP: Language Server Protocol
    The Language Server Protocol defines the protocol used
    between an editor or an IDE and a language server that
    provides language features like auto complete, go to
    definition, find all references, etc.

    View full-size slide

  8. Language Servers in Scala lang
    ● Dragos-vscode-scala
    ● Metals
    ● Dotty LS
    ● SBT server (since SBT 1.x)

    View full-size slide

  9. Editors/IDEs supporting the LSP
    ● IntelliJ
    ● Eclipse IDE
    ● VS code
    ● Atom
    ● Sublime Text 3
    ● vim8/neovim
    ● Emacs
    See ls.org and ms.lsp for the latest on adoption.

    View full-size slide

  10. Metals @scalameta

    View full-size slide

  11. Metals
    Works with: vs-code, atom, vim, Sublime text 3, Emacs.
    Uses BSP to communicate LS and build tools.
    “Our goal in Metals is to support code navigation with as low
    CPU and memory overhead as possible without sacrificing
    rich functionality.”

    View full-size slide

  12. Metals v0.7.6 - Thorium
    ● Automatic import build for Gradle, Maven and Mill
    ● Auto-fill option to case classes and functions
    ● Code completions on keywords
    ● Deduce values for named parameters completion
    ● Compilation explorer
    ● Add support for Scala 2.13 and JDK 11
    ● Coming soon: rename symbols, find definition, DAP,
    worksheets and much more!

    View full-size slide

  13. SemanticDB
    ● Portable semantic APIs
    ● Data schema for semantic information about code.
    ● Relevant for developer tools.
    ● Protobuf, JSON, SQL.
    ● Do not require a running compiler.

    View full-size slide

  14. BSP: Build Server Protocol
    ● Extends LSP
    ● Formalizes interaction between editors, LS, editors, build
    tools
    ● Bidirectional notifications,
    ● Client/server architecture.
    ● Clients are build tools, LS and editors/IDEs.
    ● Language agnostic.
    ● JSON-RPC-protobuf.

    View full-size slide

  15. Bloop
    ● sbt, Maven, Gradle and Mill.
    ● IntelliJ and Metals (VS Code, Sublime, vim and Atom)
    ● Provides fast compile, test and run
    ● Has a built-in command-line tool
    ● Integrates with most JVM build tools
    ● Supports JVM, Scala.js and Scala Native

    View full-size slide

  16. Bloop (v1.3.2)
    ● Compiling deduplication
    ● Compiling isolation
    ● Zipkin tracing support
    ● Use Ammonite by default in bloop console
    ● Support for Scala 2.13.x, JDK 9 & 11
    ● Improvements in build tools support

    View full-size slide

  17. (v1.3.3)
    ● Out-of-box Coursier integration
    ● Better classloader management
    ● IO improvements
    ● Custom incremental tasks
    ● SemanticDB support
    ● JDK 11 support

    View full-size slide

  18. Mill
    ● Build tools as Pure functional programs
    ● Fast and Flexible
    ● Targets with caching
    ● Inspectale cache graph
    ● Commands
    ● Can act as a build server
    ● Play framework and Bloop support
    ● Support for Dotty

    View full-size slide

  19. Seed
    ● Builds are describe in a TOML file
    ● Handles dependency resolution via coursier
    ● Generates configurations for Bloop and Intellij
    ● BSP server integration using ZIO
    ● Cross-platform support (JVM, JS, LLVM)
    ● Cross-compile modular projects made easy

    View full-size slide

  20. Pants
    ● Source based dependency tool
    ● Aims to large code bases
    ● Monorepo environments
    ● Fast
    ● Scalable
    ● dependency inference from source-code imports

    View full-size slide

  21. Bazel (v1.0)
    ● Reproducible builds
    ● Fast and correct builds
    ● Heavy caching
    ● Enforces build correctness
    ● Large codebases
    ● Multi-language, multi-platform
    ● Allow builds to scale

    View full-size slide

  22. TL;DR
    Tools that work with my editor => LSP
    Build integrations => BSP
    Navigation => SemanticDB, TASTy
    Refactoring => scalafix
    Diagnostics => BSP + LSP

    View full-size slide

  23. Additional links...
    https://www.scala-lang.org/blog/2018/02/14/tooling.html
    https://github.com/scalacenter/tooling-working-groups/blob/master/meetin
    gs/2018-01-17/minutes.md
    https://scala.sphere.it/#agenda
    https://contributors.scala-lang.org/c/tooling
    https://www.scala-lang.org/contribute/tools.html
    https://scala.epfl.ch/projects.html
    https://microsoft.github.io/language-server-protocol/
    https://github.com/Microsoft/language-server-protocol

    View full-size slide

  24. ¡Gracias!
    @unyagami

    View full-size slide