Archive for the 'project euler' Category


ERLANG FOR YOU!

Tuesday, July 31st, 2007

So currently Erlang is the flavor of the week. I pre-ordered the new Erlang book from Pragmatic Programmers, “Programming Erlang: Software for a Concurrent World” by Joe Armstrong. As it turns out Armstrong is also one of the original authors of the Erlang language. Now you ask: “Why would anyone want to use Erlang and whats it good for?” Guess what, you’re in luck, I’m here to tell you in fact.

Erlang is a beautiful mesh of concurrent and functional goodness that makes writing programs a succinct and (mostly) bug-free endeavor. Where Erlang exceeds though is in its concurrency abilities. It has very little overhead for creating new processes, just 300 bytes a piece compared to 1 Kb for other languages like C. These lightweight threads/processes combined with Erlang’s functional nature make it ideal for distributed systems (Oh goody! Exactly what I do in fact!).

After having had some time to play with the language, I have to say its one of the more fun languages I’ve worked in. I started out trying to write some stupid “idea” programs but quickly remembered ProjectEuler.net. I set out a day ago to rewrite some solutions to the Project Euler problems in Erlang and have had no problems. In fact I’ve gotten excellent results from Erlang and am learning a lot as I go.

Anyone who hasn’t looked into Erlang and is looking into getting into functional programming ought to have a look at it before any other language. Its a good way to ease yourself in so you don’t have to tackle the idea of Monads and such too early on which are found Haskell, Clean, and Ocaml, which are some fairly popular functional languages.