The Scala Programming Language

Created by admin on 2008-06-29.
Updated: 2010-08-09, 12:09

Introducing Scala

Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages, enabling Java and other programmers to be more productive. Code sizes are typically reduced by a factor of two to three when compared to an equivalent Java application.

Many existing companies who depend on Java for business critical applications are turning to Scala to boost their development productivity, applications scalability and overall reliability.

Seamless integration with Java

Existing Java code and programmer skills are fully re-usable. Scala programs run on the Java VM, are byte code compatible with Java so you can make full use of existing Java libraries or existing application code. You can call Scala from Java and you can call Java from Scala, the integration is seamless. Moreover, you will be at home with familiar development tools, Eclipse, NetBeans or Intellij for example, all of which support Scala. It does not take long to become an effective Scala programmer when you are half way there already!

Scala Compiler Performance

The Scala compiler is mature and proven highly reliable by years of use in production environments, The compiler was written by Martin Odersky who also wrote the Java reference compiler and co-authored the generics, used by millions of Java programmers today. You can be confident his implementation of the Scala compiler produces byte code that performs every bit as good as comparable Java code.

The Conception of Scala

After having written hundreds of thousands lines of Java himself, Martin Odersky, Professor at EPFL, was well aware of the frustrations faced by Java programmers. He formed the vision of applying the best knowledge of the academic research community to the problem of making the Java programming experience better, even fun. His first pragmatic step was Java Generics, seen as a major success by the Java community. But for the full vision of scalable concurrent programming to be achieved he saw that the basic Java syntax would need to change. You simply couldn't get there from here. But a deceptively simple shift in syntax gained better uniformity to the object-oriented aspects of Java, and this in turn enabled a natural fusion with functional programming concepts which are critical for tackling concurrency. In 2001 Scala was born.

Programming in Scala

Some Java programmers find Scala a little alien at first but soon enjoy the concise way they can express their ideas as programs. Less key-strokes to make. Type inferencing, everthing-is-an-object, function passing, and many other features cut away unneeded syntactic overhead. With growing experience they find Scala has the abstraction support to simplify the creation of safe, generic libraries that are easy to use. Some go all the way to create their own Domain Specific Language (DSL). Scala scales with the programmer. The more a programmer learns the more depth they find in Scala and the easier even more complex tasks become. Most programmers report an 'ah-ah, I get it!' moment when they suddenly see the multifaceted aspects of Scala fuse into a smoothly interlocking set of concepts with incredible problem solving power.

For the small price of learning some new syntax, anyone can write programs with the same ease that they did in Java and steadily gain in problem solving power.

A local type inference mechanism takes care that the user is not required to annotate the program with redundant type information. In combination, these features provide a powerful basis for the safe reuse of programming abstractions and for the type-safe extension of software.

Scala is extensible

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 form of libraries:

A joint use of both features facilitates the definition of new statements without extending the syntax and without using macro-like meta-programming facilities.

Scala interoperates with Java and .NET

Scala is designed to interoperate well with the popular Java 2 Runtime Environment (JRE). In particular, the interaction with the mainstream object-oriented Java programming language is as smooth as possible. Scala has the same compilation model (separate compilation, dynamic class loading) like Java and allows access to thousands of existing high-quality libraries. Support for the .NET Framework (CLR) is also available.