Saturday, November 03, 2007

Introducing the Scala Language

It is both a pure Object Oriented and fully featured Functional language.
It is both a scripting language and a compiled one.
It is a stable, solid, well designed language.
It has been very well received by a lot of people and has thousands of downloads per month.
It runs on the Java Virtual Machine and fully interoperates with the Java environment.
It has been called the "next next Java".
It is the Scala Language.

I've recently started to learn and play with it and I have to say I'm really enjoying its features.
For those with very little Functional Programming background (as I am) it may have a steep learning curve and its language features may seem too vast, but don't let them discourage you!

First start with this excellent tutorial.

Then I suggest you to start learning the following features:
  • All about classes, singleton objects, abstract types and traits.
  • Mixins.
  • Type inference.
  • Infix and postfix operators.
  • XML processing.
These are in my opinion the most important and interesting object oriented capabilities of the Scala language.

Then go with its functional side:
  • All about functions.
  • For comprehension.
  • Case classes (still to learn).
  • Pattern matching (still to learn).
  • Views (still to learn).
  • ... (still to learn).
As you can see, I have still a lot of things to learn, but I think that just its object oriented and most basic functional features make Scala a great language and a great learning/programming experience!

What about some practical use cases?

Right now I see it very well suited for:
  • Creating Domain Specific Languages (DSL) to integrate in Java applications.
  • Producing XML documents starting from data expressed in objects or some kind of DSL.
Stay tuned.
More info and ideas about my experiences with the Scala language will come soon.

No comments: