I suppose I should be writing more about the work that I’m actually doing since a) it’s the actual purpose of this blog and b) it’s far easier to write about. Today, I’ve been evaluating languages for this new project I’m working on which all I can talk about at this point is that it involves iPhones and a server. The iPhone portion obviously has to be written in Objective C (on which I’ll have more to talk about later).
Because I’m coding for myself, I have the luxury that my number 1 criteria for the language is that i enjoy coding in it and so I’ve narrowed the list down to a shortlist of contenders based on a number of criteria:
- Strong and natural support for functional programming without getting in the way of actually getting work done. I’ve dabbled with functional programming on and off for a number of years and I think I’ve gotten my head sufficiently wrapped around the paradigm but I’ve yet to dive in with any serious gusto. This seems like a good project to make a serious push towards significant use of the functional paradigm
- Abstractions for elegant horizontal scaling. Tying in with the functional aspect, the ability to at least do dumb scaling in the horizontal direction without significant rework would be a major win. I don’t know how successful this application will be and my opinion is still that thinking about scaling is a case of premature optimization but it seems plausible that properly engineered, this app should be naturally built to scale.
- Rich library support. This is kind of a no brainer and one that’s unfortunately got nothing to do with the actual language itself. I’ve had to eliminate many beautiful, clever languages from the running because of this.
- Good tool support. I’ve an unavowed IDE slut. Talk all you like about how you can configure emacs to give you blowjobs on demand in only 8000 lines of elisp, I’m just not smart enough to handle that sort of thing. I love my auto complete, i love my step through debugger and I love one button source control integration. You can talk all you like about how the standard library is so small that it can be memorized in a day, I’m 3 weeks into programming Obejective C and I *still* need to Google for the command to turn a NSString to a CString and vice versa.
- Great documentation and tutorials. I happened to start working on Ruby on Rails during the great 2.0 upgrade and the mishmash of confusing 2 year old blog posts and scant API docs made it a major pain in an otherwise wonderful framework.
- Interactive console. I’ve found the best way for me to get my head fully around a concept is to play with it a bit in an interactive console with some toy examples.
Based on these criteria, here’s my shortlist in order from most to least likely:
Python is a language I’ve never touched although it’s always been one I’ve felt like I should know. From what I’ve seen of random code samples I’ve come across, it’s as nice as everyone keeps telling me it is and I doubt the learning curve will be that steep after having learnt Ruby. From what I’ve seen, Python supports functional programming just a wee bit better than Ruby does and the way it chooses to express it fits my style better. Like Ruby, it’s roots are in the hippie open source/linux world which means I have to deal with all the tireless ideological crap that comes along with it. Not a big deal but one to consider.
One major advantage with Ruby is that I already know it so I can hit the ground running. Half of my current prototyping is done in Ruby already and the language attracts a lot of smart people which makes keeping up with it actually intellectually stimulating rather than overwhelming. It also seems to have the nicest testing facilities of all the languages and the most scarily powerful metaprogramming.
The other language I’ve been doing prototyping in, I have a lot of love for C# and it’s a beautifully designed language although from a completely different design philosophy for the Perl/Python/Ruby crowd. One major advantage of working with C# is that I get to work inside Visual Studio, my absolute most favourite IDE in the world. Static typing also gives me autocomplete that doesn’t suck and the corporate backing that C# has means it has absolutely staggeringly fabulous documentation. Since .NET 3.0, C# has apparently gotten some pretty nice functional support although I’m not sure how elegantly it integrates with the rest of the language. I’m curious to check out F# and leveraging the strengths of each language. I’ve downloaded the F# runtime a few times but have never worked up the incentive to learn the thing. It’s an interesting possibility.
I keep on hearing Groovy and Scala are the next big thing for all the cool kids but I don’t even know what they are yet let alone what they’re good for. Still, it would be an interesting chance to learn. I dislike the wordiness of Java but the ability to use any JVM library is an intriguing possibility. I’ve also never worked on a project using multiple languages before and I’d like to see what that would be like.
I have a special affinity towards Haskell as it’s the first programming language I’ve ever learnt and I became somewhat spoilt as a result of it. Still, I haven’t even scratched the surface of it and I’ve so far failed in my many attempts to grok how monads work. This blog post at Integer Overflow really sold me on the viability of Haskell as a serious albeit choice. Frankly, the ability to code search based on type signature is just so nifty that it’s pushing Haskell way up on the list. I would love working in the language but my only concern is whether it’s sufficiently flexible to adapt to the kind of work I want it to do.
We worked with Erlang in a distributed systems class in undergrad and my impression of it then was that it was a beautiful idea marred by poor language design. The weird syntax and lack of first class functions in Erlang was a majorly baffling design decision and made programming ugly and painful. However, it’s an intruging choice based on it being designed from the ground up to scale.
I can write some lisp and understand the rudiments of the language but Lisp nerds annoy me. I would love to code something in Lisp in theory but I very much have not yet found something in practice which I would want to code.
Over the next couple of days, I’m going to do a lot more reading and digesting of the various languages, mainly as an excuse to take a kind of “holiday” away from coding and I’ll be updating on the various things I’m learning. Now… onto Real World Haskell.