Perl 6 First Steps

Posted by Daniel on June 05, 2009
Perl 6, Programming

I have been working more with Perl 6 / Rakudo. I have contributed a few bug reports, and I have now ported six of the Debian shootout benchmarks to Perl 6. I’m adding all the benchmarks to the perl6-examples git repository:

git clone git://github.com/perl6/perl6-examples.git

The benchmarks are located in the ’shootout’ directory. The benchmarks implemented include Fasta, Regex-DNA, K-Nucleotide, N-Body and Reverse-Complement.

Performance

Since I mentioned benchmarks, I guess I have to mention performance…

As you might expect for a project at this stage, Rakudo is very slow. Most benchmarks run about 500 times slower than Perl 5. But that’s normal. There has been no optimization work on Rakudo, since the focus is to get the functionality done (and premature optimization is the root of all evil). In the long term, there is no reason why Perl 6 couldn’t be faster than Perl 5, thanks to its simpler grammar and its type system.

Personally I wouldn’t worry about the performance of Rakudo at this point. Besides, Rakudo is more than fast enough for a lot of simple tasks like admin scripts. I plan to rewrite my backup script in Perl 6 and run it on Rakudo.

The Perl 6 experience

So far, the experience of writing Perl 6 code has been quite pleasant. I really like the Perl 6 syntax. When I convert Perl 5 code to Perl 6 I find that the result is always clearer, always easier to read, usually shorter, never longer. The syntax is more regular (a traditional problem with Perl) and yet it is more succinct and flexible (Perl’s traditional strengths). I feel that with Perl 6 it is easier to just say what I mean. I’m impressed.

No comments yet.

Leave a comment

WP_Big_City

xanax 2mg