Questions Columns Rows
GitHub icon

Scala

Scala - Programming language

< >

Scala is an open source programming language created in 2004 by Martin Odersky.

#22on PLDB 19Years Old 219kRepos

Try now: WebRijuTIO

Scala ( SKAH-lah) is a general-purpose programming language providing support for functional programming and a strong static type system. Designed to be concise, many of Scala's design decisions aimed to address criticisms of Java. Scala source code is intended to be compiled to Java bytecode, so that the resulting executable code runs on a Java virtual machine. Read more on Wikipedia...


Example from Compiler Explorer:
// Type your code here, or load an example. object Square { def square(num: Int): Int = num * num }
Example from Riju:
println("Hello, world!")
Example from hello-world:
object HelloWorld extends App { println("Hello World") }
// Hello world in Scala object HelloWorld extends App { println("Hello world!") }
Example from Linguist:
#!/bin/sh exec scala "$0" "$@" !# object HelloWorld { def main(args: Array[String]) { println("Hello, world!") } }
Example from Wikipedia:
val urls = List("http://scala-lang.org", "https://github.com/scala/scala") def fromURL(url: String) = scala.io.Source.fromURL(url) .getLines().mkString("\n") val t = System.currentTimeMillis() urls.par.map(fromURL(_)) println("time: " + (System.currentTimeMillis - t) + "ms")
Scala Keywords
abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try true type val var while with yield

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Stats Sponsor Traffic Traffic Today Day 267 feedback@pldb.com Logout