Eric Wastl's Advent of Code is a programming challenge with a Christmas theme originally published as 2 related problems per day from 1st to 25th of December, 2015. Each problem requires writing a computer program to solve it.
Submission of a correct answer is rewarded by a star and shortly after the last problem was published over 1000 people had collected all 50 available (see the stats page). I managed (using Ruby) all except the 2nd part of day 19 which turned out to have a unexpectedly simple solution (see analysis published by askalski).
I had become aware of the challenge from a tweet by James Edward Gray II, a well known member of the Ruby community, who later published all his solutions. I wondered what I could learn from comparing James's Ruby solutions to mine and from trying to port them to Perl 5 and Elm, two other languages I'm interested in.
Many of the problems involved manipulating lists or arrays and could make use of various library utilities, if available. An example is something James used a few times but which I hadn't previously come across: each_cons (called natatime in Perl) which iterates over a given number of consecutive members of an array. Here's a summary of some list utilities that frequently cropped up in the problems and where, if they exist, to find them. Before the challenge I hadn't come across some of the Perl modules nor the List.Extra Elm package.
Often the problems would involve searches of some kind, some taking as much as a couple of minutes to complete on my computer, while others just took a few milliseconds. Despite using similar algorithms, most of the Perl programs were faster than their Ruby counterparts. The difference was greatest (almost a factor of 10) for the problems that took the least time to complete. Such a large factor was a surprise, at least for me.
Another surprise (again, maybe just for me) was that the Elm programs, running in a browser, were not always the slowest. In some cases they even beat the Ruby version.