Saturday, June 13, 2009

Mandelbrot in Perl 6

I decided to take a stab at translating mandel.pl from The Computer Language Benchmarks Game to Perl 6. I got rid of the threading, and because I was unable to get pack working (not there or just 5 AM programming issues?), I switched it from a P4 binary file to a P1 ASCII file. The resulting code runs in 3 minutes and 20 seconds, where the unthreaded version of the original runs in 0.2 seconds, so there is a lot of room for improvement here.



I'll probably also take a stab at revamping the dot function to use the Complex type, assuming it actually is implemented, and maybe making lines feel more Perl 6ish.

No comments:

Post a Comment