01 December 2007

Erlang, the functional Smalltalk?

Let’s start with a confession. I’m not a Erlang weenie, I’m not even a decent part-time Erlang hacker. But for some reason, I keep coming back to it, even through I don’t normally work in the problem domain I think Erlang is best suited for, like servers of various kinds (from MMORPG games to Jabber), or large scale, distributed applications. But in this case, it works differently - I keep coming up with problems that could be nicely solved in Erlang, instead of matching the language to the problem.

I wrote about the great fun factor of programming in Erlang before, but I didn’t quite get the reason this is the case. Now, after thinking about for a while, I think I know what Erlang does so well, that it makes programming a joy.

09 May 2007

Erlang For The Practical Man

Table of contents:

1: General overview

3: Fighting with POP3 / SSL
4: Serving the thing through HTTP
5: Putting the pieces together
6: Conlusions

This article is my submission for the Erlang blogging contest. You can also grab it as a PDF file - in a4 format or in letter format.

1: General overview

Functional programming languages are often underestimated, as they seem to be not suited for the “real world”, being thought of as designed by scientists who spend their time mainly developing theories, not practical software. What makes Erlang stand out from the crowd is the fact it was designed by the industry and for the industry. Ericsson, where the language originated, has a telecom switch with more than 2 million lines of Erlang code running it that has a downtime of a few minutes per year - now this is reliability!

Telecom switches don’t make programmers too excited those days through, so we will try to do something more related to your everyday hacking. In this tutorial I will show you how to write a standalone daemon, that checks your email every x minutes, and makes the results available as an RSS feed. If you want to centralize all your notifications around RSS this may even be useful a bit and even if not, at least it makes a good example of some of Erlang strengths. I try to explain everything in as much detail as possible, but be warned - we won’t be writing any “hello worlds” here, we will just rapidly introduce a lot of awkward stuff as it becomes necessary, so if you don’t have a solid programming background you may have serious trouble. Either way, you will probably want to consult Programming Erlang and the free, official Erlang docs if you want to do anything serious in Erlang. Also see my previous post for an overview of general high level Erlang concepts.

12 March 2007

Having Fun With Erlang

It seems that the times when programs run sequentially using one main processor are finally getting to an end… Not only more and more computations get so complex you need to use a whole network of computers to do them, not only computer clusters are increasingly popular, but also our own home computers finally have become somewhat “parallel”. As we reached the border where we can’t tune the processor frequencies so much, chip vendors seem to look for hope in multi-CPU, multi-core circuits as in Intel Core 2 Duo for example. This has multiple benefits, but also raises one big issue - the troubles with writing programs that use the multiple chips or even multiple computers efficiently. At the same time, the Web still grows, and we have more and more systems where hundreds of thousands of people interact with the software in real time (examples vary from MMORPGs to web servers).