Scala

Posted in technology by pedro | Friday, April 20th, 2007 at 2:14 pm

Our last seminar was abort scala language. I met with this language in December 2006 when I was prepared own seminary about java kingdom of languages. Martin Odersky makes experiment to create functional and object programming language. He chose java virtual machine as a compilation platform so scala has great library support.

One of very interesting feature from java perspective is patter matching (known from other functional languages SML, Heskell).

abstract class Tree
case class Sum(l: Tree, r: Tree) extends Tree
case class Var(n: String) extends Tree
case class Const(v: int) extends Tree

This snapshot is from scala tutorial. The case modifier makes from normal class a class with standard definition of getters for parameters, equals, hashCode, toString. Now through patter matching scala can evaluate Tree expression depends on the match to class Sum, Car, Const.

Scala has mixins, methods can have names like =, +, – etc., and true genericity , another interesting thin is xml included (maybe in jdk7) so we can define variable such as:

xml_data =

Imie

Last interesting fact is that scala allows you to use Actors to simple send and receive messages (Erlang style).

It’s very interesting language and of course we have even now web framework for it. It’s name is lift

Leave a Reply

about me

My name is Sebastian Pietrowski. I've finished Warsaw University as Master degree. I started my journey with Java 1.1 with Thread and JDBC programing in 1998 as I worked for merlin.pl. In 1999 I've passed Java Programer Certificate for Java 1.2, and was solution architect of merlin.pl infrastructure when we was moving from pl/sql to J2EE. It was great performance optimization with 10 times more req/sec than in requirements and 85 times faster as original solution.

Currently I work as Expert Software Development Java at F.Hoffmann-La Roche. The company was founded in 1896 and today, Roche employs over 80.000 people. After work I'm involved in activities related to Scala/Lift, Ruby/Rails/Merb, Python/Django. This is because I try to be pragmatic also I'm focused on application performance and tuning with success in my daily work.

My Yoda's motto: Do, or do not. There is no try.