scala
Scala programming language interpreter and REPL
TLDR
Start REPL
SYNOPSIS
scala [-cp classpath] [-e expr] [options] [script] [args]
DESCRIPTION
scala runs Scala programs and provides an interactive REPL. Scala combines object-oriented and functional programming on the JVM.
The REPL evaluates expressions and shows results with types. Tab completion helps explore APIs. :help shows REPL commands.
Scripts run directly without compilation. The Scala 3 runner can execute .scala files as scripts with dependencies.
Classpath specifies libraries and compiled classes. Maven coordinates can specify dependencies in Scala 3.
Compiler explanations help understand complex error messages. The explain mode provides detailed reasoning.
The language supports type inference, pattern matching, implicits, and higher-order functions. It interoperates with Java seamlessly.
PARAMETERS
-cp PATH
Set classpath.-e EXPR
Evaluate expression.-J FLAG
Pass flag to JVM.-deprecation
Show deprecation warnings.-explain
Explain errors in detail.-feature
Show feature warnings.-help
Show help.-print-lines
Show line numbers.-source VERSION
Source compatibility version.-version
Show version.-X
Show advanced options.-Y
Show private options.
CAVEATS
Scala 3 differs significantly from Scala 2. JVM startup adds latency. Memory usage can be high. Some features have learning curve.
HISTORY
Scala was designed by Martin Odersky at EPFL in Switzerland, with version 1.0 released in 2004. Scala 3 (Dotty), released in 2021, brought significant language improvements.
