Categories
Programming

Language of the month: Scala, part 2

For the last 3 weeks or so I was checking out Scala, and will do for a little while more, so just want to do a little catch up where things are at the moment.

Start

I tried to find a couple of starting points to start to know about Scala. First thought video tutorials or talks would be useful, so been around checking on YouTube. It seems the mainly referenced intro is Scala: a scalable language. Well, it told me a lot about how Scala compares to other languages and how is it better than those, but not much to start learning it. Though the talk made it sound like it is one of the best and most modern languages out there, taking the most useful ideas from loads of other languages.

Had a copy of the Pragmatic programmer: Programming Scala, and just finished going through it. By that I mean that skimmed all the chapters and did try some of the code samples that looked interesting or strange. Not bad, but from the book I just have a very limited answer to the question of: “but what is it really great for?” Concurrency, sure, but that is probably not all.

I don’t know a language before I code enough in it, but before I know it I don’t have to much inspiration what to code. In this case, programming puzzle sites come very handy, though not all of them support Scala. I went to Coderloop because they do and I can submit my solution for performance testing, or could use Project Euler because they are language agnostic (one sends the results only).

Experience

Since Scala is built upon the Java Virtual Machine and supports pretty much all of Java, it feels a little Frankenstein language: every now and then, even for some things that should be quite commonly used, things have to be programmed in Java. Lots of language features are cool, though, even if most of it feels just syntactic sugar. In a way, maybe the whole language is just that? It’s not bad, makes things very concise and powerful, but always feels there’s something more in the background.

Actors and concurrency are pretty cool, though. In the talks I’ve seen people compared them to Erlang, just even more powerful. This is something more to play around with, would like to make something interesting, scalable and fault-tolerant – those are the fun stuff aren’t they? (But this also makes me want to try Erlang soon so I can compare).

Since I was doing mostly Python lately, it feels a bit weird to use a compiled language. For simple programs, it takes quite a long time to do that compilation, enough to wind me up a little when I was troubleshooting. That said, maybe I’m doing a little bit too much “programming by accident“, so I deserve it? Also, starting a Scala program takes a while as well, though once it is up and running, it’s pretty fast.

At this point, I’m not totally sure yet what project to make until the end of the month. I need more programming itches to scratch. The only ideas I came up so far are self-playing games with actors. Or some server/provider. Well, just keep brainstorming, something better has to come up. Maybe when I dive a little bit more into it, since at the moment I cannot really “think Scala” yet.

There’s also a web framework for it, called Lift, which is probably not surprising. The close connection wit Java (and hence with so many of enterprise software) and event based, fault tolerant concurrency is just too juicy. Not sure if anyone’s hosing it, tough (got to check out), either way I can just try it on my local network. I wonder how does it compare to Django, since that’s what I have a bit of experience with.

Links

Information

Example sources

Companies using Scala

Others writing about Scala

(Last updated: 2011 June 23)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.