Joe Armstrong's Favorite Erlang Program... in LFE

Posted on December 31, 2013 by oubiwann


Blog post image

It kind of shocked me to discover recently that a new post hasn't been pushed out on this blog since April. Looking at the drafts I've got backlogged – 30 and counting – I also realized that none of these were going to get finished in a single day. Of those 30, probably 6 will ever see the light of day, and all of those are drafts in various states of completion for the Lambda Calculu s series.

There's a great Tiny Scheme example I want to write about, some cool Clojure stuff I've played with, and bunch of functional programming work I'd like to share, etc., etc., but again, none of these are anything I can complete in a few minutes (allowing me to do the other things that I'd like to do today!).

I'd given up, when I remembered that there was something short, sweet, and a bit of ol' fun that I wanted to share! Mr. Erlang himself recently blogged about it, and I wanted to convert it to LFE: Joe Armstrong's Favorite Erlang Program.

This little puppy is quite delightful – and Joe shares a great little story about how he deployed it on Planet Lab in his "aside" section of that post :-)

After you read his post, come back and take a look at this code:

That's how you do it in LFE! (Also, did you notice that Github now knows how to colorize *.lfe files? That happened here.)


< /div>
Ain't it just the purdiest thing you ever saw?

This code has also been submitted for inclusion in the LFE examples (thus the "examples/" below). Let's do a quick sanity check:
And now, let's run the example!

Happy New Year, everyone :-D


Author oubiwann
Date December 31, 2013
Time 17:08:08
Category
Tags code erlang examples functional-programming lambda calculus lfe lisp scheme writing
Line Count 1
Word Count 320
Character Count 2945

Comments?
This blog doesn't use standard (embedded) comments; however, since the site is hosted on Github, if there is something you'd like to share, please do so by opening a "comment" ticket!