Thursday, December 26, 2013

Why Scala

Pros
  1. Scala runs on jvm - the most mature and trusted vm, that is fast, really fast, on linux one can make use of mmapped files, epoll, AsynchronousChannel and other stuff. Take a look at Resin web server, it is fast as hell (by hell I mean nginx, resin has bigger memory footprint but can process requests as fast, but a part of resin is written in C though).
  2. Scala can reuse any java library (and they are many) and run in various java containers such as any Servlet/Web Profile container like Resin/Tomcat/Glassfish or even OSGi one.
  3. Scala absorbed almost every good thing from programming languages existed in past 40+ years (Lisp - 1958, ML - 1973, Haskell - 1990, Java - 1995). For those who loved Typeclasses in Haskell Scala has implicits that are effectively the same beast. And unlike academic languages such as Lisp and Haskell Scala has good practical focus.
  4. Scala has mature and proven Akka framework that is a copy of Erlang OTP - best thing for highly available and scalable applications. See Case Studies. You will love supervision trees, transparent from application perspective distribution of actors among nodes, declarative executors configuration, IO model, etc. Akka IPC is based on Netty that is one of the best Java IO frameworks that even implements its own buffer pool to not suffer from GC. Akka has also its own cluster implementation with the Gossip protocol on board.
  5. Scala has its own web frameworks like Play and Spray, both on top of Akka.
Cons
  1. Scala is a bit complex. Ideally one needs to have experience in Java (you'll be using jvm and java libs anyways), Haskell (to understand functional stuff), Erlang OTP (to properly use Actors and reactive programming).
But here one more Pros
  1. You can write application in java and start writing some parts in Scala that make it possible to transfer smoothly.

No comments:

Post a Comment