You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
5.2 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <link rel="icon" type="image/png" href="/favicon.ico">
  7. <link rel="canonical" href="https://www.mcmillen.dev/sigbovik/">
  8. <link rel="alternate" type="application/atom+xml" href="https://www.mcmillen.dev/atom.xml" title="Colin McMillen's Blog - Atom">
  9. <title>93% of Paint Splatters are Valid Perl Programs | Colin McMillen</title>
  10. <link rel="preconnect" href="https://fonts.gstatic.com">
  11. <link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@500;700&display=block" rel="stylesheet">
  12. <link href="https://fonts.googleapis.com/css?family=Fira+Mono:500&display=block" rel="stylesheet">
  13. <link rel="stylesheet" href="/pygments.css">
  14. <link rel="stylesheet" href="/style.css">
  15. </head>
  16. <body>
  17. <div id="page-container">
  18. <div id="content-wrap">
  19. <div id="header">
  20. <div class="content">
  21. <a href="/" class="undecorated">Colin McMillen</a>
  22. <span style="float: right;"><a href="https://twitter.com/mcmillen"><img src="/img/twitter.svg" alt="@mcmillen"></a></span>
  23. </div>
  24. </div>
  25. <div class="content">
  26. <h1 id="93-of-paint-splatters-are-valid-perl-programs">93% of Paint Splatters are Valid Perl Programs</h1>
  27. <p><em>Posted 2019-04-01.</em></p>
  28. <p>TLDR: <a href="2019.pdf">read the paper</a> and <a href="splatters.html">view the gallery of pretty Perl programs</a>.</p>
  29. <p>In this paper, we aim to answer a long-standing open problem in the programming languages community: <em>is it possible to smear paint on the wall without creating valid Perl?</em></p>
  30. <p>We answer this question in the affirmative: it <strong>is possible</strong> 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.</p>
  31. <p><a href="https://twitter.com/jaffathecake/status/1095706032448393217"><img alt="Screenshot of a Twitter conversation. Adrienne Porter Felt says: &quot;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?&quot; Jake Archibald replies: &quot;but is it possible to smear paint on the wall without creating valid Perl?&quot;" src="/media/20190401-sigbovik-tweet.png"></a></p>
  32. <p>Accepted for publication at SIGBOVIK 2019, held April 1st 2019 in Pittsburgh. Winner of a Unwitting Participation Ribbon, &ldquo;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.&rdquo;</p>
  33. <p>Read it on <a href="https://docs.google.com/document/d/1ZGGNMfmfpWB-DzWS3Jr-YLcRNRjhp3FKS6v0KELxXK8/preview">Google Docs</a> or download a <a href="2019.pdf">PDF</a>. Or grab the <a href="http://sigbovik.org/2019/proceedings.pdf">entire SIGBOVIK 2019 proceedings</a>; I&rsquo;m on page 174.</p>
  34. <h2 id="supplementary-materials">Supplementary Materials</h2>
  35. <p>Here&rsquo;s <a href="splatters.html">all the paint splatters</a> on a single page, along with the valid Perl source code corresponding to each. &ldquo;Not valid&rdquo; 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 &ldquo;interesting&rdquo;, according to my own aesthetic sense.</p>
  36. <p>Here&rsquo;s a <a href="splatters.tar.gz">tarball of 100 paint-splatter images</a> that were used as the main dataset for this paper.</p>
  37. <p><strong>(source code not available yet because i am bad at GitHub)</strong></p>
  38. <h2 id="errata">Errata</h2>
  39. <p>There are a few paint splatter Perl programs that I didn&rsquo;t recognize as &ldquo;interesting&rdquo; until after the SIGBOVIK submission deadline. For example, this splatter is recognized by OCR as the string <code>lerzfijglpFiji-j</code>, which evaluates to the number <code>0</code> in Perl:</p>
  40. <p><img alt="paint splatter" src="splatters/6b78f8696b05f9322b2dda21b6932776.jpg"></p>
  41. <p>The image below is recognized as the string <code>-*?</code>, which also evaluates to the number <code>0</code> in Perl:</p>
  42. <p><img alt="paint splatter" src="splatters/e47b8463b359906947c66ec4c852a2a3.jpg"></p>
  43. <p>Another surprising program is shown below; OCR recognizes this image as the string <code>;i;c;;#\\?z{;?;;fn':.;</code>, which evaluates to the string <code>c</code> in Perl:</p>
  44. <p><img alt="paint splatter" src="splatters/803dd5a54c42ed93462c78ad7da357b0.jpg"></p>
  45. <p>Finally, this image is recognized as the string <code>;E,'__'</code>, which evaluates to the string <code>E__</code> in Perl:</p>
  46. <p><img alt="paint splatter" src="splatters/dc86c1c3553705b7b2f973d5be9e0389.jpg"></p>
  47. </div>
  48. </div>
  49. <div id="footer">
  50. <div class="content">
  51. &copy; 2021 <a href="/" class="undecorated">Colin McMillen</a>.
  52. </div>
  53. </div>
  54. </div>
  55. </body>
  56. </html>