Do you know what a program chrestomathy is? How about a phrasebook? Or a cribsheet? What about the Rosetta Stone?
RosettaCode.org is much like any of those, though it focuses primarily on programming languages. It’s organized as hundreds of ‘tasks’, which are roughly problem statements, and each task is shown with implementations in many languages.
The gist? Let’s say you know how to do something in language A, and want to see how to do it in language B. By comparing A and B across enough problems, you will start to get a feel for language B’s syntax, and how it relates to the language you’ve come from. Then you’ll notice recurring design patterns and behaviors–the language’s idioms. You’ll be able to see where these are similar to habits you already have, and you’ll be able to see where your existing habits might be get in your way.
Enough preamble. Allow me to direct your attention to a specific places on the site. The topic here isn’t Rosetta Code, really, but how it can help you with Perl 6.
First, there’s a list of all tasks on Rosetta Code which have Perl 6 implementations. Here are a few examples:
- Trivial file I/O
- A Brain**** interpreter
- Conway’s Game of Life
- Using turtle graphics to build a spiral matrix
Of course, we can’t talk about these kinds of lists of programs without touching on some classics, can we?
As I write this, there are 243 examples of Perl 6 code on the site. If I were to link to all the cases I think you might find interesting, this post would be a link-bomb of amazing proportion. However, allow me to throw one more link at you.
I’ve already given you a link to an index of all 243 of the existing Perl 6 code on the site. As I write this, though, there are 449 tasks. If you’d like to fill in some of the gap…