perl and AtariBASIC, part III

scrottie on 2010-06-23T18:46:01

In a Perl 6 talk, pmichaud felt necessary to justify to the audience why something was a bit cryptic: he was running out of space on the line. dconway, from the back, commented "If I had a dollar for every time someone wrote unmaintainable code with that excuse...", prompting me to point out on IRC that putting lots of stuff on one line is an optimization technique in AtariBASIC. The moment I said that I realized (or remembered) that Perl has exactly the same problem: it does a linear traversal through statements looking for the target label (or line, in AtariBASIC). The more statements it has to traverse to find the target, irregardless of size, the longer it takes.

Therefore, it follows that longer lines in Perl make for faster programs.

http://slowass.net/user/scott/tmp/gotot.pl.txt

-scott