File:Scala-full-color.svg · Wikimedia Commons · See Wikimedia Commons
Also known as Scala programming language
general-purpose programming language
via Wikipedia infobox
~40 min read
Scala (/ˈskɑːlɑː/ SKAH-lah) is a strongly statically typed high-level general-purpose programming language that supports both object-oriented programming and functional programming. Designed to be concise, many of Scala's design decisions are intended to address criticisms of Java.
Scala source code can be compiled to Java bytecode and run on a Java virtual machine (JVM). Scala can also be transpiled to JavaScript to run in a browser, or compiled directly to a native executable using Clang. When running on the JVM, Scala provides language interoperability with Java so that libraries written in either language may be referenced directly in Scala or Java code. Like Java, Scala is object-oriented, and uses a syntax termed curly-brace which is similar to the language C. Since Scala 3, there is also an option to use the off-side rule (indenting) to structure blocks, and its use is advised. Martin Odersky has said that this turned out to be the most productive change introduced in Scala 3.
This is the home of the Scala 2 standard library, compiler, and language spec. Issues and bug reports for Scala 2 are located in scala/bug. That tracker is also where new contributors may find issues to work on: good first issues, help wanted. To contribute here, please open a pull request from your fork of this repository. If your change affects the standard library, see CONTRIBUTING.md for remarks about what sort of changes might be accepted in Scala 2 and/or Scala 3. We require that you sign the Scala CLA before we can merge any of your work, to protect Scala's future as open source software. For more information on building and developing the core of Scala, read the rest of this README, especially for setting up your machine! In order to get in touch with other Scala contributors, join the scala-contributors channel on the Scala Discord chat, or post on contributors.scala-lang.org (Discourse). @lrytz back end, optimizer, named & default arguments, reporters @retronym compiler performance, weird compiler bugs, lambdas @SethTisue getting started, build, CI, community build, Jenkins, docs, library, REPL @dwijnand pattern matcher, MiMa, partest @som-snytt warnings/lints/errors, REPL, compiler options, compiler internals, partest @Ichoran collections library, performance @viktorklang concurrency, futures @sjrd interactions with Scala.js @bishabosha TASTy reader @joroKr21 higher-kinded types, implicits, variance Target the oldest branch you would like your changes to end up in. We periodically merge forward from 2.12.x to 2.13.x. Most changes should target 2.13.x, as 2.12.x is now under minimal maintenance. MacOS and Linux work. Windows may work if you use Cygwin. Community help with keeping the build working on Windows and documenting any needed setup is appreciated. During ordinary development, a new Scala build is built by the previously released version, known as the "reference compiler" or, slangily, as "STARR" (stable reference release). Building with STARR is sufficient for most kinds of changes. However, a full build of Scala is bootstrapped . Bootstrapping has two steps: first, build with STARR; then, build again using the freshly built compiler, leaving STARR behind. This guarantees that every Scala version can build itself. If you change the code generation part of the Scala compiler, your changes will only show up in the bytecode of the library and compiler after a bootstrap. Our CI does a bootstrapped build. Bootstrapping locally : To perform a bootstrap, run restarrFull within an sbt session. This will build and publish the Scala distribution to your local artifact repository and then switch sbt to use that version as its new scalaVersion . You may then revert back with reload . Note restarrFull will also write the STARR version to buildcharacter.properties so you can switch back to it with restarr without republishing. This will switch the sbt session to use the build-restarr and target-restarr directories instead of build and target , which avoids wiping out classfiles and incremental metadata. IntelliJ will continue to be configured to compile and run tests using the starr version in versions.properties . Building with fatal warnings : To make warnings in the project fatal (i.e. turn them into errors), run set Global / fatalWarnings := true in sbt (replace Global with the name of a module—such as reflect —to only make warnings fatal for that module). To disable fatal warnings again, either reload sbt, or run set Global / fatalWarnings := false (again, replace Global with the name of a module if you only enabled fatal warnings for that module). CI always has fatal warnings enabled. Once you've started an sbt session you can run one of the core commands: compile compiles all sub-projects (library, reflect, compiler, scaladoc, etc) scala / scalac run the REPL / compiler directly from sbt (accept options / arguments) enableOptimizer reloads the build with the Scala optimizer enabled. Our releases are
Excerpt from the source-code README · 17,352 chars · not written by Vinony
via Wikidata · CC0
via Wikidata sitelinks · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).