One of the greatest unsung benefits of the Pugs project (an experimental implementation of Perl 6) is that it has created, last I checked, some 15,000 test cases for Perl 6, with thousands more on the way.

I’ve realized something as I’ve worked on the Parrot part of Perl 6….

Parrot rebooted somewhat around the end of June 2006, during the hackathon after YAPC::NA 2006. Since that time, it’s attracted a handful of really great new committers and has had a tremendous amount of new development and improvements.

Though Parrot started out as the intended production platform for Perl 6, another goal was always to make a great platform for any dynamic language. Right now, there are a couple of dozen languages that target Parrot in whole or in part, with maybe half of them in good shape — Tcl, Perl 1, Perl 6, Scheme, Ruby, APL, bc, HQ9+, and more.

Part of the reason for the renewed interest in Parrot is because it has impressive compiler tools. Allison Randal, the new Parrot chief architect and the driving force behind most of these compiler tools, claims that people think writing compilers is difficult because they have to use clunky and painful tools. (It’s time to bury flex, lex, yacc, and bison.)

Making it easier to target Parrot means that more people can target Parrot with new and existing languages. For example, today in #parrot on irc.perl.org, a couple of people helped solve a problem with Cardinal (the Ruby port) and a few others discussed plans to get JavaScript working on Parrot in the near future.

I should note that all of these languages can interoperate in process.

All of this work and planning made me realize something important that I’ve never put into words before. Open languages need open, independent test suites.

It’s good to have a language specification, but you can’t beat a comprehensive, executable specification that anyone can download and read and run. Perl 1 had one way back in 1987, and Perl 5.9.x has a huge number of tests.

One of the greatest unsung benefits of the Pugs project (an experimental implementation of Perl 6) is that it has created, last I checked, some 15,000 test cases for Perl 6, with thousands more on the way.

Imagine how much easier it would be to make Cardinal or Pecan (hey, no one has named JavaScript on Parrot yet; it looks a little like ECMA and starts with “P”) work effectively if it were possible to run just the test suite with the language itself, starting from the barest possible sanity tests and working up to the complete, full language.

Obviously there are licensing concerns and trademark concerns — it seems to me that allowing people to redistribute and run the test suite and, if unmodified, call their implementations “compatible” is good, though distributing modified versions of the suites should not lead to confusion. (The Artistic License 2.0 seems reasonable here.) As well, it’s important to have the legal power to distinguish a compliant implementation from a non-compliant implementation.

Still, having a good test suite helps the language itself and it helps interoperability, especially in this new age of languages running on several good virtual machines and platforms.

Now how do language developers and implementors and designers and users encourage this?