Scala tooling ecosystem

Tomasz Godzik  
トマシュ ゴ ジ ク
@ VirtusLab

Yay!

Tomasz Godzik

Senior Scala Developer

Who am I

Tomasz Godzik

Senior Scala Developer

also

team lead for Scala Ecosystem Team

Open source tooling

Goals for the talk

Show the full scope of the tooling landscape

発表のゴール: Scala開発者ツールの全容を伝える

Increase confidence in the tooling

発表のゴール: ツールに自信が持てるようにする

Mention some useful features

発表のゴール: いくつか便利な機能を紹介する

Tooling landscape

What is a tool?

It's not always clear what is the border between tools and libraries.

 

For this presentation, a tool is anything that will not be shipped with your code

 

I am not covering testing frameworks.

 

この発表での「ツール」は自分のコードと共にリリースされないもの全般を指す

And I couldn't cover every tool I wanted :(

すべてのScalaツールを紹介しきれません :(

Tool

no.

 ❓ Why ❓

Why you might want to use it?

 

なぜそのツールを使いたいのか?

Tool

no.

 ❓ What ❓

What is it actually?

 

そのツールは何なのか?

Tool

no.

⚙️ Features if there is anything worth mentioning

 

⚙️また、各ツールの便利な機能についてお話します。

???

2010

  • you want to have an IDE experience
  • you want direct information from the Scala 2 and 3 compiler
  • you want to use new Scala 3 features right from the start
  • you want to use different editors

 

Scala3に関する十分なIDE機能を自分の好きなエディタで使いたいときに使おう

 ❓ Why ❓

Metals

2010

Language server for the Scala Programming language available to use in your favourite editor.

 

Metalsは好きなエディタで利用できるScalaの言語サーバー

 

 

 ❓ What ❓

Metals

2010

⚙️ Bazel support released

⚙️ Feature parity between Scala 2 and 3 released

⚙️ Implementations in dependencies released

⚙️ Inlay hints released

⚙️ Better support in broken workspaces in progress

​⚙️ Work being done on opt in telemetry in progress

 

特筆すべき機能

???

1997

  • You want to manage and find dependencies 

 

は依存関係を管理・検索したときに使う

 ❓ Why ❓

Coursier

1997

Library and command line tool for managing, caching and downloading artifacts.

 

Coursierは依存関係の管理・キャッシュ・ダウンロードするためのライブラリ・CLI

 ❓ What ❓

Coursier

1997

⚙️ Search dependencies using complete-dep command

⚙️ Use coursier as simple package manager via coursier/apps

⚙️ Use Java API without Scala deps for maximum isolation

 

complete-depコマンド・パッケージマネージャとして利用・Java API

???

1395

  • you want uniform formatting across the team and you don't want to waste time on reviews
  • you want to use something that is integrated into almost all Scala tooling
  • you want to experiment with different styles

 

チーム間でコーディングスタイルを統一したい・あらゆるScalaツールに対応

 ❓ Why ❓

Scalafmt

1395

Configurable formatter for Scala programming language

 

設定可能なScalaのコードフォーマッタ

 ❓ What ❓

Scalafmt

1395

⚙️ Switch to optional or even fewer braces

⚙️ Automatically add end markers

⚙️ Use a wide choice of settings for optimal look

 

fewer bracesの設定・end marker追加など

???

1118

 ❓ Why ❓

  • you want to keep your dependencies up to date and limit tech debt

 

依存ライブラリなどのバージョンを最新に保ちたい

Scala Steward

1118

 ❓ What ❓

Tool and bot to automatically update dependencies in maven, sbt, mill and Scala CLI projects

 

sbt/mill/scala-cliの依存を更新するツール・bot

Scala Steward

1118

⚙️ Use it for Scala CLI!

⚙️ Public instance run by VirtusLab

⚙️ Can be run on github actions

 

scala-cliにも使える! ・VirtusLabが公開インスタンスを提供・github actions

???

1086

 ❓ Why ❓

  • you need to parse or generate Scala code
  • you want to get type information outside the compiler

 

Scalaコードをパース・生成したい。semanticdbを利用したい

 

Scalameta

1086

 ❓ What ❓

Compiler independent parser for both Scala 2 and 3.

 

Also semanticdb plugin for Scala 2 that generates type information in protobuf format.

 

コンパイラに非依存なScala2/3のパーザー・semanticdb生成のプラグイン

Scalameta

1086

⚙️ Use it with AST explorer to understand parsers better

⚙️ Useful for a number of other tools for automatic refactorings

⚙️ Will be compiled with Scala 3 soon

 

AST explorer・他ツールが便利に利用可能・もうすぐScala3対応

???

1064

 ❓ Why ❓

  • You want to improve your codebase to avoid common bugs
  • You want to add non standard linting 

 

一般的なバグを避けたい・複雑なリントルールを使いたい

Wartremover

1064

 ❓ What ❓

Compiler plugin that provides a number of additional linting options as well as a way to create new ones.

 

たくさんのリント機能を備えたコンパイラプラグイン・ルール自作も可能

Wartremover

1064

⚙️ Create rules specific to your use case using the compiler based API.

⚙️ Take a look at existing rules to help eliminate bugs in your code.

 

compiler APIを使ったリントルールの自作・既存ルールもたくさん

???

796

  • You want to automatically refactor and improve your codebase

 

自動的にコードベースを改善したい

 ❓ Why ❓

Scalafix

796

Automatic refactoring and linting tool for Scala 2 and 3

 

Scala2とScala3対応の自動リファクタリングツール

 ❓ What ❓

Scalafix

796

⚙️Automatically add types to improve compilation speed

⚙️ Create new rules with a custom API without the need to know the compiler one

 

型アノテーションの自動追加・型情報を使った独自ルールの作成

???

488

 ❓ Why ❓

  • you want to write a simple application or script
  • you want to have a simple tool for learning or experimenting

 

Scalaの簡単なプロジェクトやscriptを作りたい・Scalaの学習に便利なツール

Scala CLI

488

 ❓ What ❓

Command line tool for compiling, running, testing and packaging your Scala code.

 

Scalaコードをコンパイル・実行・テスト・パッケージするためのCLI

Scala CLI

488

⚙️ Create scripts with shebang to be easily invoked

⚙️ Easily compile with Scala Native or Native Image

⚙️ Compile markdown files

⚙️ Experiment with ScalaPy and Spark

⚙️ Soon will be the default Scala runner!

 

shebangでscriptのようにScalaを実行・ネイティブイメージ生成・もうすぐscalaコマンドはscalacliに!

???

423

 ❓ Why ❓

  • you don't want to use a physical machine
  • you want to easily share your experiments
  • you want to provide users with examples of your library

 

オンラインでScala環境を使いたい・コードを簡単に共有したい

Scastie

423

 ❓ What ❓

Online web page environment to write and run your Scala code

 

Scalaコードを書いたり実行できるウェブページ

Scastie

423

⚙️ Built-in Metals support for hover and completions

⚙️ Embed Scastie examples in your docs!

⚙️ Use tree sitter syntax highlighting

⚙️ Scala CLI support coming soon

 

IDEサポート・ドキュメントにscastieの埋め込み・treesitterによるシンタックスハイライト...

???

384

 ❓ Why ❓

  • you want to type check or run your documentation
  • you want to enrich your documentation with some more interactive features
  • you want to write custom worksheets

 

ドキュメント内のScalaコードに対する型チェックなど

Mdoc

384

 ❓ What ❓

Library for compiling or running Scala snippets in your documentation or outside.

 

ドキュメント内のScalaスニペットをコンパイル・実行するためのライブラリ

Mdoc

384

⚙️ Use it to make sure your docs are always up to date!

⚙️ Generate static website with Mdoc and Docusaurus

 

ドキュメントのコードが正しいかをチェック・docsaurusへの埋め込み

???

80

 ❓ Why ❓

 You want to have a ready set of libraries to use as an enhancement of the standard library

 

シュッと(httpやjsonなどの)便利なライブラリを使いたいとき

Scala Toolkit

80

 ❓ What ❓

Set of libraries recommended to use, which support all possible Scala version and platform configurations.

 

推奨されるScalaライブラリのセット・あらゆるScalaバージョンとバックエンドに対応

Scala Toolkit

80

⚙️ Useful for creating scripts for your CI

⚙️ There are other toolkits already such as Typelevel one

⚙️ Requires `//> using toolkit default` in Scala CLI

⚙️ Other tools require specific dependency

 

スクリプトのために便利・typelevel版・//> using toolkit default

More!

x

  • Intellij
  • scala native
  • scala js
  • ammonite
  • jardiff
  • scalap
  • flamegraph
  • JMH
  • metabrowse
  • community build
  • tasty query
  • tasty inspector

 

  • bloop
  • scoverage
  • laika
  • ZIO Intellij plugin
  • scala dependency submission
  • sbt version policy
  • tasty mima
  • mima
  • sbt plugins
  • scalably typed
  • Scala Debug Adapter
  • Almond

Please report issues!

問題があったらissueをレポートしてください

We can come try and organize online sprees or knowledge shares together.

That can be a great way to share knowledge and start to work on the issues that bug you.

 

オンラインOSS開発会に参加・開催するのは開発に参加する良い方法

Programming Sprees

But remember

 

Any feedback is useful! Voice it!

あらゆるフィードバックは貴重です!

This presentation

Our Scala 3 roadmap

Twitter:         @TomekGodzik,

Mastodon:   fosstodon.org/@tgodzik

Email:            tgodzik@virtuslab.com

Scala Tooling Ecosystem - Scala Matsuri

By Tomek Godzik

Scala Tooling Ecosystem - Scala Matsuri

  • 174