Live data from Hacker News

93% of Paint Splatters Are Valid Perl Programs

colinm.org

21–30 of 135 posts

Re: 93% of Paint Splatters Are Valid Perl Programs

#21
post #14

I miss Perl. Why did PHP win again, in the late 90s? (though I'm mostly Python these days and shan't complain, there was a good 10 year stretch of PHP there I'm not proud of).

PHP won because it was easy to install and restrict (by memory usage) on shared servers, as well as the fact that writing a PHP script was as simple as renaming an .html file to .php so web designers who wanted some dynamic functionality could use it really easily. As bad as some aspects of PHP were, making it so trivial to install and make available on a server was a brilliant move that lots of languages could still…

The parent nailed it. It's easy to complain about PHP from various standpoints both pragmatic and PL-centric, but it has an amazing superpower which might be summed as "serverless for the web, v0".

Re: 93% of Paint Splatters Are Valid Perl Programs

#25
post #19
post #10

I love this footnote so much: > This feature does enable a neat quine: the Perl program “Illegal division by zero at /tmp/quine.pl line 1.”, when saved in the appropriate location, outputs “Illegal division by zero at /tmp/quine.pl line 1.” The reason for this behavior is left as an exercise for the reader.

It's trying to divide "Illegal division by zero at /" by "tmp/quine.pl line 1." and "tmp/quine.pl line 1." evaluates to 0?

Or "quine.pl line 1." Evaluates to 0?

Or should that be 0.0???

Re: 93% of Paint Splatters Are Valid Perl Programs

#26
> We manually filtered out all images with any form of overlaid or watermarked synthetic text, because the Perl program (?) “iStock by Getty Images” is not particularly interesting.

It's also not a valid Perl program:

    bash-4.3$ perl -e "iStock by Getty Images"
    Can't locate object method "Getty" via package "Images" (perhaps you forgot to load
    "Images"?) at -e line 1.

Re: 93% of Paint Splatters Are Valid Perl Programs

#29
post #2

93% of random OCR outputs are valid Perl programs. The paint splatters are a distraction.

There’s at least an infinite number of infinitely long inputs to Perl. Which proportion of these will terminate without an error?

Trick question.

An infinitely long input will never finishing reading, so we'll never find out :)

Re: 93% of Paint Splatters Are Valid Perl Programs

#30
Well, curmudgeonly, I'd have preferred if the splatters were interpreted with a greater degree of codified structure than OCR.

I mean, OCR doesn't guarantee consistent output, and furthermore, it's not like a person could discern how or why the characters that fall out of the "recognition" are what they are.

I feel there should be a way to transform a paint splatter to a perl expression (or any plain text string at all) according to well-defined, reversible procedure.

Post reply on HN