preload
Apr 01

Over the last couple of weeks I’ve been exploring and programming in Erlang. It has been an interesting, informative but challenging and frustrating experience.

Do you remember the scene in Young Frankenstein where Gene Wilder, playing Frankenstein and … whoever it was, playing the monster do the soft-shoe-shuffle and sing ‘Putting On The Ritz’? Well, the gag is that the monster, despite his grotesque, clumsy, clumsily-assembled form carries out the dance immaculately until, right at the end he sings his one line of the song. When he howls, “Puttin’ on a riiiitz’ I nearly wet myself laughing. Erlang’s like that.

Erlang is a horrid language, Damien Katz recently pointed out what he considered to be the flaws of the language, and I’d largely agree with his take on things. Actually things are worse than he makes out, he doesn’t critique the documentation which is poor and he doesn’t point out the problems of cruft and half-implemented abandoned features in the implementation. In response to his posting, someone in the comments points out that Erlang does have a package/namespace mechanism which is true. The topic of packages came up last week on the mailing list - someone pointed out that it didn’t seem to work properly. The answer they got was that that was put in as an experiment at the start of the decade, it didn’t work properly and that the implementers might take it back out at some point .. if they got around to it. Other features like module attributes have a similar story.

Katz chops away at some of, what he considers to be, the more egregious ugliness of the language, he doesn’t bother with the minor warts. But I find that there are enough of these warts that they become irksome. For example, macros have to start with a ? which leaves you code looking confused and ugly - why are there so many questions and so few answers? Lisp macros fit in with the language, they are indistinguishable from normal forms and so they create an extensible, grow-able language. Erlang macros stand out, they feel like something you should avoid because they are strange and ugly.

But, all these things said, I still find that Erlang and OTP - like the monster’s dance - has moments of grace, beauty and style. There are things in there to love. Erlang does processes and monitoring better than anything I’ve ever seen, it truly is remarkable in this aspect. If I needed to write an application where concurrency was more important than anything else, I might well look to Erlang.

So, Erlang, I’ve learned from you - I’m a better programmer for having spent a couple of weeks with you. But, for now, all I see is a monster capable of some clever tricks … and you’re going back in the box, until I need you.

Mar 16

Damien Katz, and his family, sold their house and lived off their savings so that he could write free software.

His honesty and his story left me, literally, in tears. But truly inspired.

Please watch it.

Mar 15

Trying to get CouchDB set up, I’ve had to install macports. Macports is a neat tool that makes a lot of apps and libraries available for the Mac. Many of these are old-school Unix libraries and it seems that it isn’t just the code that the Macport team wanted to bring to the Mac - they wanted to bring the Unix user experience too.

I downloaded the installer and ran it. It gave me a lovely progress bar that pottered from zero to about seventy percent in 2 mins or so. Then it just sat there. After about twenty five minutes I tried to stop it .. and it said “No, I’m not going to stop”. Before killing it I decided to see if it was doing anything. I opened a terminal and ran top. It seemed that there were multiple rsync processes consuming CPU. Digging around I found that the installer was actually doing something - downloading files from the mother-ship. I decided not to kill it and another 20 minutes later it finished.

Why do people do this sort of thing? If they’d written an installed that flashed up a message saying “This could take a while” I’d be content to wait. Giving me a progress bar that just stops for most of an hour is madness, the worst possible UI decision. Showing me nothing would have been better because then, at least, it wouldn’t have looked broken.

I’m now all stressed because I have code on my system written by people who thought that UI was a good idea. What other insanity do they have in store?

Mar 15

I’ve now watched all eight episodes of Erlang in Practice a series of screencasts by Kevin Smith[1] and it was money well spent.

Having watched a expert write in Erlang for six hours, I feel I have a much better understanding of the flow of Erlang development. It isn’t as good as sitting down with someone and pair-programming, but it is as close as I can get. Watching someone write code is a very different experience from reading a book on the subject: each has something unique to offer. A book can teach you syntax and tricks and libraries and all of the static parts of a language, it can’t show you the way an expert thinks. The way an expert gets from A to B, the mistakes they make, the paths they go down before refactoring; things that even experts can’t tell you, but they can show you.

The only thing I didn’t like about the ‘casts were that on a number of occasions Kevin ( I feel like we’re best buds after spending the day together ) would make a mistake that I spotted and, no matter how much I yelled at the screen, I couldn’t get him to fix it. It felt like I was at the theatre shouting “look behind you” and the actors stubbornly refused to comply. That’s a minor thing, though. Informative, entertaining and (if you’re geek enough) fun.

I hope he does more.

[1] Sadly not that Kevin Smith, seeing Erlang written by Silent Bob would be great.

Mar 15

My foray into the World of Erlang continues. I’m excited and energised by the new and interesting things I’m discovering. Learning to think in terms of messages passed between processes isn’t easy, or natural yet; but I’m getting there.

I do have some concerns though. Erlang has been around for a very long time ( in computer years ) and has a few people who date back to the beginning still involved. Many members of the Erlang community are, however, quite new to the language and are working at trying lots of different ideas - some of them new, some of them translations of ideas from other languages.

What this means, for me, is that when I look around for a library to perform a certain task I’ll find a bunch of different options, each with a different approach, none of them are stable and none of them have any strong hints about their future. It seems that Erlang is such a fertile place for experimentation, and the community is so young, that projects spring up, are used briefly and are abandoned before they reach their potential.

Take web-frameworks for example. I want a UI for an app I’m considering and a web-ui would be just-the-thing. I looked around and there are loads of different web frameworks and web servers. I don’t have any trust that any of them will be actively maintained three years from now. I can’t create a critical dependency between my work and a project that may or may not have a future.

I’m not criticising people for their efforts (I will in a moment though) people are entitled to spend their time and efforts in whatever way they want. Erlang has drawn innovators, early adopters and those dissatisfied with the tools and options they had elsewhere. The relatively blank canvas is, I’m sure, what attracted many people to the language. There’s new ground to be broken, clean slates to be drawn on and blank sheets to be filled with ideas. All wonderful stuff.

The problem I have isn’t with innovation and creativity. The problem I have is with people who innovate, create, persuade other people to use what they are creating and then get bored and forget it. If you write up some code, dump it on git-hub and say “world, it is there if you want it” that’s one thing. If you create a project, put together a pretty project page telling people why it is cool and why they should use it then you’ve created a social contract you’re obliged to support your work. If you don’t want to make the commitment then don’t act like you are.

People who create, advertise and evangelise, then abandon open source projects are doing the world an active dis-service. Why?

  • There’s only so much time and attention to go round. Many/most projects are not original - they’re similar to other existing projects. By creating an only slightly divergent copy of something you dilute the market of the original, reducing their chances of success.
  • Open Source has, in most fields, killed off the market for commercial products. I don’t have the choice to pay someone for a quality product because the market has been devalued. Killing off the commercial market and replacing it with nothing is a distressing scenario.
  • It provides an impediment to those who might follow through on an idea. Many in the Open Source community dislike the idea of forking or creating copy-cat projects. If you create an abandon-ware project you’ve added an extra barrier for others to cross.

Just to be clear here. I don’t have a problem with Open Source. I’ve used it for many years. I’ve spent some of the last few years providing technical support for Open Source applications and libraries. I’ve found good Open Source projects to be, without question, the equal of their commercial counterparts. I’ve watched innovation and change come from the Open Source community, positively affecting the entire industry. I like Open Source. I get annoyed by Open Source dilettantes and their here today/gone tomorrow behaviour.

I have an Open Source project of my own. I’m not going to point to it, because I don’t want you to use it. I made the code available for myself and a couple of other people. I have a disclaimer on it saying “there’s no good reason for you to use this” because it is treading old ground and I’m not going to maintain it. If someone finds it and uses it .. that’s fine, if nobody ever does that’s fine too. But nobody will ever believe that it is a project they can depend on.

So what’s my point?

The Erlang community right now has many smart people in it. They have lots of ideas and they want to try them out. There’s almost as many ideas as people, so there are mostly small communities and unstable projects. There’s certainly exceptions to this rule such as CouchDB and RabbitMQ, but in general I don’t see many significant communities building significant projects. For my benefit, and that of everyone else, I’d like that to change.

If you’re about to create a project or release some code you have as an Open Source project, please consider these question:

  • If you have an idea that you’d like to try out, could you do it under the banner of an existing project?
  • If you want to build a product, just like X. Could you contact the people who build X and help them out? You’d probably end up with something better than either of you could on your own.
  • If you just want a creative outlet, do you have to start from a blank slate or would working with a community on something in existence be fulfilling?
  • Would picking up someone else’s abandon-ware and carrying that forward be viable?
  • Are you really going to devote the time necessary to maintain this for the next n years? Where n is a number that at least twice as big as you’d expect.
  • Do you just want to show people something cool that you bashed together? If so, have you made it clear that this was just a one-off that you’ve made available to that people can learn from it or carry on if they’re interested?

Whatever else people may tell you, Java has been a success because of the communities associated with it. In particular the Apache Jakarta community was instrumental in making Java the phenomenon that it became. They had rules, they had standards, they had ethics and lots of smart people talking and building great things. Companies and individuals would adopt projects because they were Apache products - it was a name you could trust. The name and the community had respect and trust. Smart individuals looking to work on interesting problems gravitated there. Those with interesting ideas would go there and find other like-minded people to help them.

Erlang doesn’t seem to have that community, not yet anyway. But it does have enough people to create that community. At the moment they’re consumed by experimentation, and there is no central place or group that seems to be a likely candidate. Some languages never coalesce around a community and are forever fragmented and experimental e.g. Smalltalk. This isn’t necessarily bad, things are what they are.

Right now, I’m enthusiastic and energised, but I’m also cautious and concerned. Erlang looks like it could be ideal for the problem I want to solve; I just don’t think I trust the basket enough to put all my eggs in it.

Mar 13

Looks like I jumped aboard the Erlang train just in time. If I’d waited any longer I might have missed the chance to be Munctional.

Mar 11

I’ve changed. I’m surprised how much. A couple of years ago when I was playing with Erlang I thought it was OK, it had some interesting features .. but nothing special. I don’t know what has changed since then, I think perhaps it is all the time I’ve spent with Clojure, but I have a new appreciation for the beauty of functional languages. I am excited.

Mar 09

I’ve spent a few hours bashing away with Erlang now, and things have certainly come a long way since 2007 when I last devoted any time to Erlang.

Actually, not everything has come a long way. The only platform that you can get binaries for on erlang.org is Windows. I was working on Windows the last time I poked at Erlang so I probably didn’t notice this last time round. Compiling from source isn’t a huge deal but … this is 2009, if you want people to try something, forcing them to compile from source before they can try it out doesn’t seem like the path of least resistance.

After compiling I looked around for an editor and many fingers pointed to Erlide. I must admit, I wasn’t expecting much - I haven’t been pleasantly surprised by Eclipse plugins for off-the-beaten-path languages in the pase. I must admit, I’ve been pleasantly surprised by Erlide. It has all of the basic functionality I’d want and a little extra that I wasn’t expecting with some refactoring functionality that was released today. The one piece that doesn’t seem to be there is a code formatter, which surprises me as that’s normally one of the first things to get done. There may even be one in there somewhere and I just haven’t found out the incantation to get it going.

So, I have Erlang installed, and I have an editor/IDE. Next stop, some educational materials. I have Joe Armstrong’s book Programming Erlang which is a pretty good text, but I’d like to warm up with some shorter pieces, whet my appetite going and get me back into the flow of things. The main Erlang site has some pretty good tutorials here.

After getting back up to speed on language basics I need look through the libraries that are available. In 2007 there wasn’t much beyond the OTP stuff that ships as part of the Erlang distribution. That’s changed, there is now a plethora of libraries and frameworks, in various stages of maturity, that I’ll need to look into before I really have any sort of handle on Erlang development.

Mar 09

I got involved in a discussion a few days ago in the Scala mailing list. I made a statement based on an experience that was related to me, rather than something I’d tested for myself. Alexis Richardson disagreed with me and the commends I’d made about Erlang and RabbitMQ strongly, and said so.

None of the above is noteworthy, people disagree about things all the time. What is noteworthy is that Alexis remained calm, measured, polite and considered all through the discussion. This is such a pleasant change from the usual mailing list pattern that I thought it was worth mentioning.

As a tribute/thankyou to Mr Richardson and his well-mannered ways, I’ve decided that I’m going to give Erlang - a language that wasn’t on my list - a second chance, and try it for the personal project I mentioned a few days ago.