Scala has the same compilation model as Java and C# (separate compilation, dynamic class loading), so Scala code can call Java libraries (or .NET libraries in the .NET implementation).

Scala's operational characteristics are the same as Java's. The Scala compiler generates byte code that is nearly identical to the Java compiler. In fact, you can decompile Scala code to readable Java code, with the exception of certain constructor operations. To the JVM, Scala code and Java code are indistinguishable. The only difference is a single extra runtime library, scala-library.jar.[4]

The Scala software distribution, including compiler and libraries, is released under a BSD license.[5]

As of Oct 2009, the latest release is version 2.7.7. Features planned for Scala 2.8 include an overhaul of the Scala collections library, named and default parameters for methods, package objects, and continuations.[8]

Extensibility

The design of Scala acknowledges the fact that, in practice, the development of domain-specific applications often requires domain-specific language extensions. Scala provides a unique combination of language mechanisms that make it easy to smoothly add new language constructs in the form of libraries:

In April 2009 Twitter announced they had switched large portions of their backend from Ruby to Scala and intended to convert the rest.[10] In addition, Wattzon has publicly been noting that its entire platform has been written from the ground up in Scala.[11]

Assuming the program is saved in a file named HelloWorld.scala, it can then be compiled from the command line:

> scalac HelloWorld.scala

To run it:

> scala -classpath . HelloWorld

This is analogous to how a Java "hello world" program is compiled and run. Indeed, Scala's compilation and execution model is identical to that of Java, making it compatible with Java build tools such as Ant.

It is also possible to feed this program directly into the Scala interpreter, using the option -i (to load code from the file) and the option -e (to execute additional code needed to actually invoke the HelloWorld object's method):

See also

References

↑"Scala on .NET". Programming Methods Laboratory of EPFL. 2008-01-07. http://www.scala-lang.org/docu/clr/. Retrieved 2008-01-15. "Scala is primarily developed for the JVM and embodies some of its features. Nevertheless, its .NET support is designed to make it as portable across the two platforms as possible."