www-builder/content/sigbovik/index.md

3.3 KiB
Raw Blame History

93% of Paint Splatters are Valid Perl Programs

Posted 2019-04-01.

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.

Screenshot of a Twitter conversation. Adrienne Porter Felt says: "I don't want to teach my kid to code. I want him to splash in muddy puddles and smear paint on the walls and read novels under the covers way too late at night. I grew up too soon and wish I'd had more time to be a kid. Why do schools teach vocational skills so young these days?" Jake Archibald replies: "but is it possible to smear paint on the wall without creating valid Perl?"

Accepted for publication at SIGBOVIK 2019, held April 1st 2019 in Pittsburgh. Winner of a Unwitting Participation Ribbon, "an unwelcome brand weve 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.

Supplementary Materials

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)

Errata

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:

paint splatter

The image below is recognized as the string -*?, which also evaluates to the number 0 in Perl:

paint splatter

Another surprising program is shown below; OCR recognizes this image as the string ;i;c;;#\\?z{;?;;fn':.;, which evaluates to the string c in Perl:

paint splatter

Finally, this image is recognized as the string ;E,'__', which evaluates to the string E__ in Perl:

paint splatter