43 lines
3.1 KiB
Markdown
43 lines
3.1 KiB
Markdown
# 93% of Paint Splatters are Valid Perl Programs
|
||
|
||
Published 2019-04-01.
|
||
|
||
TLDR: [read the paper](2019.pdf) and [view the gallery of pretty Perl programs](splatters.html).
|
||
|
||
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.
|
||
|
||
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">but is it possible to smear paint on the wall without creating valid Perl?</p>— Jake Archibald (@jaffathecake) <a href="https://twitter.com/jaffathecake/status/1095706032448393217?ref_src=twsrc%5Etfw">February 13, 2019</a></blockquote>
|
||
<script async src="https://platform.twitter.com/widgets.js"></script>
|
||
|
||
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](https://docs.google.com/document/d/1ZGGNMfmfpWB-DzWS3Jr-YLcRNRjhp3FKS6v0KELxXK8/preview) or download a [PDF](2019.pdf). Or grab the [entire SIGBOVIK 2019 proceedings](http://sigbovik.org/2019/proceedings.pdf); I'm on page 174.
|
||
|
||
## Supplementary Materials
|
||
|
||
Here's [all the paint splatters](splatters.html) 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](splatters.tar.gz) 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](splatters/6b78f8696b05f9322b2dda21b6932776.jpg)
|
||
|
||
The image below is recognized as the string `-*?`, which also evaluates to the number `0` in Perl:
|
||
|
||
![paint splatter](splatters/e47b8463b359906947c66ec4c852a2a3.jpg)
|
||
|
||
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](splatters/803dd5a54c42ed93462c78ad7da357b0.jpg)
|
||
|
||
Finally, this image is recognized as the string `;E,'__'`, which evaluates to the string `E__` in Perl:
|
||
|
||
![paint splatter](splatters/dc86c1c3553705b7b2f973d5be9e0389.jpg)
|