44

93% of Paint Splatters Are Valid Perl Programs

 5 years ago
source link: https://www.tuicool.com/articles/hit/iiuIVrN
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

93% of Paint Splatters are Valid Perl Programs

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 aPDF. 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:

RRnAbaR.jpg!web

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

aYZ7RjB.jpg!web

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:

AnIveue.jpg!web

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

YNZjEbn.jpg!web


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK