I used to be a big Perl user during my early career. For the last 6 or so years, I almost stopped using Perl except for the one-liners that I write during my work. Today I stumbled upon an article written by Evan Miller on why he started learning Perl6. It was not an wake up call for me to go back and learn Perl6. There were a couple of things that I felt very compelling to me. - M:n threading support while keeping the syntax readable (without callback hell) - The immutable string representation is awesome (chords based)
I use Python for almost all scriting that I do at work. I wanted to check how Python's string representation fares with Perl6's string representation. I must admit that Perl6 rocks.
$ /usr/bin/time python3 -c 'a = "abcd"; a = a*100000; a=a*100000;'
Traceback (most recent call last):
File "<string>", line 1, in <module>
MemoryError
Command exited with non-zero status 1
0.03user 0.00system 0:00.04elapsed 93%CPU (0avgtext+0avgdata 9024maxresident)k
0inputs+0outputs (0major+1101minor)pagefaults 0swaps
$ /usr/bin/time perl6 -e 'my $a = "abcd"; $a = $a x 100000; $a = $a x 100000;'
0.13user 0.01system 0:00.14elapsed 99%CPU (0avgtext+0avgdata 71704maxresident)k
0inputs+0outputs (0major+12650minor)pagefaults 0swaps
$ # Let us stress test Perl6 even more by elongating the string even further.
$ /usr/bin/time perl6 -e 'my $a = "abcd"; $a = $a x 100000; $a = $a x 100000; $a = $a x 100000;'
1.63user 1.95system 0:08.43elapsed 42%CPU (0avgtext+0avgdata 5275924maxresident)k
10744inputs+0outputs (48major+500330minor)pagefaults 0swaps
$ # You see, Perl6 didn't crash!