How scala/scala3 works
Scala 3 is the home of the Scala language compiler and standard library, with adjacent developer tools including the REPL, presentation compiler, and Scaladoc. The central user workflow is to submit Scala source to the compiler and produce platform-specific output; compiler internals also model language constructs and types. This workflow is represented at a high level because the sampled excerpts do not expose the ordinary compiler phase pipeline. Edges are limited to relationships visible in the SOURCE INDEX or sampled source; unsampled capabilities are included without guessed calls.
Main entry points: Driver.scala Compiler Driver · Contexts.scala Compiler Contexts · Main.scala TASTy Decompiler · ScriptEngine.scala REPL
Components 16
Compiler
- Compiler Driver
compiler/src/dotty/tools/dotc/Driver.scala - Compiler Contexts
compiler/src/dotty/tools/dotc/core/Contexts.scala - Symbols and Names
compiler/src/dotty/tools/dotc/core/Symbols.scala - Application Typer
compiler/src/dotty/tools/dotc/typer/Applications.scala - TASTy Format
tasty/src/dotty/tools/tasty/TastyFormat.scala
Standard Library
- Scala Library
library/src/scala/Option.scala - Primitive Types
library/src/scala/Int.scala - Mutable Collections
library/src/scala/collection/mutable/ListBuffer.scala
Developer Tools
- REPL
repl/src/dotty/tools/repl/ScriptEngine.scala - Script Evaluation
compiler/src/dotty/tools/scripting/Main.scala - Presentation Compiler
presentation-compiler/src/main/dotty/tools/pc - Scaladoc Generator
scaladoc/src/dotty/tools/scaladoc/Main.scala - TASTy Decompiler
compiler/src/dotty/tools/dotc/decompiler/Main.scala
Platforms
- JVM Backend
compiler/src/dotty/tools/backend/jvm/CodeGen.scala - Scala.js Backend
compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala
Other components
- Scala Developer
Connections 16
- Scala Developer → Compiler Driver: compiles source
README.md - Compiler Driver → Compiler Contexts: initializes context
compiler/src/dotty/tools/dotc/Driver.scala - Compiler Contexts → Symbols and Names: provides definitions
compiler/src/dotty/tools/dotc/core/Contexts.scala - Application Typer → Compiler Contexts: uses context
compiler/src/dotty/tools/dotc/typer/Applications.scala - Compiler Driver → JVM Backend: emits JVM output
- Compiler Driver → Scala.js Backend: emits JavaScript output
- Scala Developer → REPL: evaluates snippets
- REPL → Scala Library: uses Scala values
repl/src/dotty/tools/repl/ScriptEngine.scala - Scala Developer → Script Evaluation: runs script
- Script Evaluation → Compiler Contexts: uses compiler context
compiler/src/dotty/tools/scripting/Main.scala - Scala Developer → Presentation Compiler: requests code assistance
- Scala Developer → Scaladoc Generator: generates API docs
- Scaladoc Generator → Compiler Driver: uses compiler driver
- Scala Developer → TASTy Decompiler: inspects TASTy
- TASTy Decompiler → Compiler Driver: uses driver
compiler/src/dotty/tools/dotc/decompiler/Main.scala - TASTy Decompiler → TASTy Format: reads TASTy format