Static

93% of Paint Splatters Are Valid Perl Programs (2019)

First reported by Mcmillen.dev ·

The signal ●○○○ Compiled by AI from Mcmillen.dev and Hacker News
Why you might care

Randomly generated visual noise can surprisingly execute as valid code.

What happened

In a 2019 study, Colin McMillen investigated whether random paint splatters could accidentally form valid Perl programs. Using optical character recognition (OCR) software to analyze images of paint splatters, the research found that a significant 93% of these random splatters parsed as valid Perl code. The paper, presented at SIGBOVIK 2019, explored the properties of these "paint-splatter Perl programs." While the majority of splatters were valid Perl, the study also identified seven specific examples of paint splatters that did not parse as valid Perl programs. The research aimed to address the open problem in the programming languages community of whether it's possible to create a paint splatter that is *not* a valid Perl program. The study concluded that it is indeed possible to smear paint without creating a valid Perl program, though this occurs in only 7% of cases.

What it means

This research highlights the unexpected robustness and expressiveness of the Perl programming language, demonstrating how its syntax can be mimicked by seemingly random patterns. The findings suggest that even non-intentionally crafted visual inputs have a high probability of conforming to a complex programming language's structure.

This unexpected result has implications for code obfuscation, generative art, and potentially even error detection in programming languages. It prompts further investigation into the statistical properties of programming language grammars and their susceptibility to accidental or adversarial generation from unstructured data.

AI-written summary. May contain errors.

Paint