93% of paint splatters are valid Perl programs (2019)

TLDR: read the paper and view the gallery of pretty Perl programs.

简而言之:请阅读这篇论文并查看精美的 Perl 程序图库。

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?

在本文中,我们旨在回答编程语言社区中一个长期存在的问题:是否有可能在墙上涂抹油漆而不产生有效的 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.

我们给出了肯定的回答:确实有可能在墙上涂抹油漆而不产生有效的 Perl 程序。我们采用了一种实证方法,利用光学字符识别(OCR)软件,发现仅有 93% 的油漆溅痕可以被解析为有效的 Perl 代码。我们分析了这些油漆溅痕 Perl 程序的特性,并展示了七个无法解析为有效 Perl 程序的油漆溅痕示例。

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.”

本文被 2019 年 4 月 1 日在匹兹堡举行的 SIGBOVIK 2019 会议录用。它获得了“无意参与奖章”(Unwitting Participation Ribbon),这是“我们贴在每篇经过仔细审查并包含真实人工制品的论文上的一个不受欢迎的标签,旨在促进开放科学和富有成效的拖延这一崇高事业。”

Read it on Google Docs or download a PDF. Or grab the entire SIGBOVIK 2019 proceedings; I’m on page 174.

请在 Google Docs 上阅读或下载 PDF 版本。或者获取 SIGBOVIK 2019 的完整会议论文集;我的文章在第 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.

这里是在单页上展示的所有油漆溅痕,以及与每个溅痕对应的有效 Perl 源代码。对于那些无法解析为有效 Perl 程序的图像,我用红色标注了“Not valid”(无效)。如果不同的 OCR 设置识别出多个有效的 Perl 程序,我会根据自己的审美选择看起来最“有趣”的一个。

Here’s a tarball of 100 paint-splatter images that were used as the main dataset for this paper.

这里有一个包含 100 张油漆溅痕图像的压缩包,它们是本文的主要数据集。

(source code not available yet because i am bad at GitHub)

(源代码尚未发布,因为我不擅长使用 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:

有一些油漆溅痕 Perl 程序直到 SIGBOVIK 提交截止日期后,我才意识到它们很“有趣”。例如,这个溅痕被 OCR 识别为字符串 lerzfijglpFiji-j,在 Perl 中其求值结果为数字 0:

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

下图被识别为字符串 -*?,在 Perl 中其求值结果同样为数字 0:

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:

下面展示了另一个令人惊讶的程序;OCR 将此图像识别为字符串 ;i;c;;#\?z{;?;;fn’:.;,在 Perl 中其求值结果为字符串 c:

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

最后,此图像被识别为字符串 ;E,'', 在 Perl 中其求值结果为字符串 E: