Monday, July 24, 2006

Erlang vs. the One Red Paper Clip Guy

A couple of weeks ago, I submitted to digg.com an article I wrote comparing Erlang + Yaws and Ruby on Rails as alternative framworks for web development, with the intention of raising awareness about Erlang's web development capabilities. I then waited for the moment that web developers from all corners of the earth would flock to my blog, read the posting, and see the light. Although this may have happened on a small scale, my posting certainly didn't change the course of mainstream web development: my posting only got 18 diggs the last time I checked.



Never abandoning my mission to raise people's awareness about Erlang's benefits, I decided to take a different angle -- one that is destined to grab more people's attention. In this posting, instead of comparing Erlang to Ruby on Rails, I decided to compare it to Kyle MacDonald, the One Red Paper Clip Guy.



Where do I start? Well, let's enumerate some of Erlang and Kyle's traits and see how they compare to each other:




  • Paradigm: Erlang is a functional language, which means that the primary conceptual units in Erlang are functions. This contrasts with object oriented languages, which emphasize classes and objects, and procedural languages, which emphasize subroutines and not much more.


    Kyle, on the other hand, is apparently dysfunctional. Kyle was unemployed at the start of his journey, and instead of looking for a proper job, he decided to execute a series of trades from the red paper clip on his desk all the way up to a house. Kyle happened to succeed in his quest, but if any normal person tried the same feat, most people would probably wonder what's wrong with him.


    Winner: Erlang



  • Concurrency: Erlang was designed for concurrent programming. Erlang handles concurrency very well, and its lightweight approach to threads allows it to execute millions of tasks in parallel.


    Kyle, on the other hand, is a male, and hence is particularly bad at multitasking. In fact, chances are that Kyle can only do one thing at a time. (If you're a guy and you can't find any substantive research on the subject, just ask your wife, mom or girlfriend -- while playing CounterStrike. Case closed.)


    Winner: Erlang



  • Performance: As I mentioned in the last item, Erlang was designed for parallel programming. This means that Erlang is very good for solving problems that can be decomposed into multitudes of parallel processes. Erlang doesn't have the fastest performance in linear tasks, but it has no competition in scalable, parallel applications.


    By contrast, Kyle seems to excel in tasks that require a sequence of calculated steps until he reaches his goal. Kyle won't give up before he succeeds. Without this determination and perseverance, Kyle wouldn't have been able to trade a paper clip all the way up to a house -- all in the course of one year.


    Winner: tie



  • High availability: Kyle is human, so Kyle needs to sleep. Kyle can't actively pursue his goals with anything close to the %99.9999999 (yes, nine nines!) availability that Erlang applications can accomplish.


    Winner: Erlang (by a wide margin)



  • Spawning: Kyle has no children, and if he ever decides to have them, it's likely he won't make more than 3 or 4 of them due to numerous biological, social and economic constraints.


    In Erlang, on the other hand, it's quite easy to spawn new processes. Just call the spawn() function, and you have a new process in a matter of milliseconds. You can spawn millions of processes if you want, and the Erlang VM would handle it with ease.


    It may seem as though Erlang is the clear winner, but when you consider the hypothetical effects of Kyle's spawning millions of children, you realize that Kyle's limited spawning ability is actually a big benefit to humankind. Therefore, my verdict is:


    Winner:tie



  • Yaws: According to Wikipedia, Yaws is "a tropical infection of the skin, bones and joints caused by the spirochete bacterium Treponema pertenue." By all indications, Kyle is a healthy guy and is also Yaws-free.


    Erlang, on the other hand, has Yaws. In Erlang's case, however, Yaws stands for "Yet Another Web Server." Erlang's Yaws is actually a wonderful web server uniquely suited for developing dynamic web applications with highly scalable and robust backends (in case you're wondering, I have no indication that the same adjectives also apply to Kyle's back end).


    Erlang's Yaws is a great web server, but the negative connotations of its name warrant the loss of some points. Therefore, my vedict is:


    Winner: Kyle



  • Popularity: Kyle is quite popular. Due to people's fascination with Kyle's story, Kyle's blog has had over 6,600,000 visits and Kyle has gotten press coverage from mulitple news agencies.


    Erlang, on the other hand, isn't a very popular programming language. Just look at this Google Trends graph in case you have any doubts. This isn't because Erlang isn't a good language -- it's actually the best language for a certain class of problems IMO -- but because Erlang hasn't had the best PR. It's also because many people actually think that PHP is a good language.


    Winner: Kyle





Here's the final tally.




  • Erlang: 3




  • Kyle MacDonald, aka the One Red Paper Clip Guy: 2





Ladies and gentlemen, we have a winner: Erlang!


Now that you've read this highly convincing exposition, you can safely forget everything you know about web development and head over to the Erlang web site, the Yaws web site, or read my other Erlang articles (starting with the Hitchhiker's Guide to Erlang). Learn, practice and experiment with Erlang, and in a couple of months you'll be building telcom-grade backends for your websites with ease. I assure you it'll be worth it!

5 comments:

Ivan, the mean Java dev. said...

This blog posting was as consequential as sipping a Diet Coke during a Sprite commercial.

Yariv said...

Ahh... too bad! I was going for the Seltzer feel :)

Ivan, the mean Java dev. said...

No I'm kidding, I've learned two important things today: Erlang is worth checking out, and I should begin cornering the market on red paperclips.

Yariv said...

Thanks! I'm happy I was able to pique your curiousity. Have fun chasing those paper clips. :)

Sam said...

Your link to your Hitchhiker's article resulted in a 404 for me.