93% of Paint Splatters are Valid Perl Programs
Published April 1, 2019
TLDR: read the paper and view the gallery of pretty Perl programs.
In this paper, we aim to answer a long-standing open problem in the programming languages community: is it possible to smear paint on the wall without creating valid Perl?
We answer this question in the affirmative: it is possible to smear paint on the wall without creating a valid Perl program. We employ an empirical approach, using optical character recognition (OCR) software, which finds that merely 93% of paint splatters parse as valid Perl. We analyze the properties of paint-splatter Perl programs, and present seven examples of paint splatters which are not valid Perl programs.
but is it possible to smear paint on the wall without creating valid Perl?— Jake Archibald (@jaffathecake) February 13, 2019
Accepted for publication at SIGBOVIK 2019, held April 1st 2019 in Pittsburgh. Winner of a Unwitting Participation Ribbon, "an unwelcome brand we’ve affixed to each paper determined after careful scrutiny to have included a genuine artifact, thereby furthering the admirable causes of open science and fruitful procrastination."
Read it on Google Docs or download a PDF. Or grab the entire SIGBOVIK 2019 proceedings; I'm on page 174.
Here's all the paint splatters on a single page, along with the valid Perl source code corresponding to each. "Not valid" is written in red for those images which did not parse as valid Perl programs. If different OCR settings recognized multiple valid Perl programs, I chose the one that seemed the most "interesting", according to my own aesthetic sense.
Here's a tarball of 100 paint-splatter images that were used as the main dataset for this paper.
(source code not available yet because i am bad at GitHub)
There are a few paint splatter Perl programs that I didn't recognize as "interesting" until after the SIGBOVIK submission deadline. For example, this splatter is recognized by OCR as the string
lerzfijglpFiji-j, which evaluates to the number
0 in Perl:
The image below is recognized as the string
-*?, which also evaluates to the number
0 in Perl:
Another surprising program is shown below; OCR recognizes this image as the string
which evaluates to the string
c in Perl:
Finally, this image is recognized as the string
;E,'__', which evaluates to the string E__ in Perl: