It is my opinion that every language was created for a specific purpose. What was Scala created for and what problems does it best solve?
Scala combines object-oriented and functional programming in one concise, high-level language. Scala's static types help avoid bugs in complex applications, and its JVM and JavaScript runtimes let you build high-performance systems with easy access to huge ecosystems of libraries.
Scala is a statically-typed, general-purpose programming language that can be both Object-Oriented as well as Functional, which makes it a very flexible language.
Scala is dynamic and strongly statically typed language. It provides type interface for variables and functions that is better than limited type interface in other language like C# and Java. It also provides a compiler that uses type reference to a full extent.
One of the things mentioned in talks by Martin Odersky on Scala is it being a language which scales well to tackle various problems. He wasn't talking about scaling in the sense of performance but in the sense that the language itself can seem to be expanded via libraries. So that:
val lock = new ReentrantReadWriteLock lock withReadLock { //do stuff }
Looks like there is some special syntactic sugar for dealing with j.u.c
locks. But this is not the case, it's just using the scala language in such a way as it appears to be. The code is more readable, isn't it?
In particular the various parsing rules of the scala language make it very easy to create libraries which look like a domain-specific language (or DSL). Look at scala-test for example:
describe("MyCoolClass") { it("should do cool stuff") { val c = new MyCoolClass c.prop should be ("cool") } }
(There are lots more examples of this - I found out this one yesterday). There is much talk about which new features are going in the Java language in JDK7 (project coin). Many of these features are special syntactic sugar to deal with some specific issue. Scala has been designed with some simple rules that mean new keywords for every little annoyance are not needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With