logoalt Hacker News

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

483 points • by zenincognito • yesterday at 10:34 PM • 60 comments • view on HN

Comments

snitty • yesterday at 11:40 PM

SIGBOVIK papers are almost always a delight

EDIT: From their 2026 publication

>Permission to make digital or hard copies of portions of this work for personal use is granted; permission to make digital or hard copies of portions of this work for classroom use is also granted, but seems ill-advised

gnabgib • yesterday at 11:07 PM

Popular in:

2024 (515 points, 125 comments) https://news.ycombinator.com/item?id=40197013

2021 (431 points, 165 comments) https://news.ycombinator.com/item?id=27929730

➕ show 2 replies
layer8 • yesterday at 11:22 PM

Tangentially related, the only way for a Java properties file to be invalid is if it contains an invalid Unicode escape sequence (“\u” not followed by four digits, and not preceded by an odd number of “\”). After resolving Unicode escapes, any character sequence is a valid properties file.

➕ show 1 reply
zenincognito • yesterday at 10:38 PM

The actual paper is also highly entertaining - https://www.mcmillen.dev/sigbovik/2019.pdf

➕ show 5 replies
dukoid • today at 1:01 PM

Now I wonder if that holds for Objective C programs, too....

rurban • today at 9:48 AM

That's with the flexible perl5 parser with a dynamic lexer, which allows everything. For my new faster perl backend perl11-p2 I am using a PEG parser, similar to raku, which needs static rules for everything. So I bet it will not accept most of the noise. But I still can run only 50% of all perl programs.

ideasphere • today at 3:47 AM

I’m more interested in how the OCR missed that ‘Stitch & Shutter’ watermark in the third one.

➕ show 2 replies
baron3dl • today at 12:32 AM

i loved programming perl. both the act, and the book. i long since gave it up, but i am still awed by how it could both be completely unceremonious and absurdly ceremonious. my $self = shift; for instance.

idlewords • today at 1:22 AM

A whole new twist on "Hackers and Painters"

jacquesm • today at 12:51 AM

Someone should reverse that and see how many paintings can be made to execute as Perl and what those programs do when invoked.

➕ show 1 reply
isolay • today at 9:38 AM

> fruitful procrastination

It is so rare to find proper appreciation for this creative skill.

charcircuit • today at 6:42 AM

This is more about a bad OCR than about paint splatters. They also tried multiple OCR settings until one worked. If you used more accurate OCR this would be very different.

➕ show 1 reply
SoraTakai • today at 3:32 AM

It all depends on which OCR to use and therefore meaningless. It is especially more meaningless since they do not establish the baseline (OCR "pass" % on random input).

➕ show 1 reply
xenic • today at 5:41 AM

Perl is such a ride. I wrote and maintained a nms/statistics/alerting stack around 2003-2004, ended up being around 200k LoC iirc. Just heard it is still in use at that company. My condolences to whoever has had to maintain that monster.

I was somewhat pleasantly surprised a few days ago when an LLM out of the blue decided to use perl, not python, for some simple scripting. There is hope in the world yet…

➕ show 1 reply
brisket_bronson • yesterday at 11:49 PM

Figure 6 represents the string “gggijgziifiiffif”, which by pure coincidence happens to accurately represent the authors’ verbal reaction upon learning that “unquoted strings” were a feature intentionally included in the Perl language

➕ show 2 replies
polarsanel • today at 1:48 AM

93% of Perl Programs are valid Paint Spatters too.

silvandeboer • today at 6:59 AM

The modern version would be to input the image without further context into an LLM and constrain the output to valid Rust.

sadboi_fandango • yesterday at 11:00 PM

Jackson Pollock was writing perl code all along

➕ show 2 replies
criemen • yesterday at 11:59 PM

> Apparently in the brave new world of neural nets, Anything Goes™

Quite some foresight indeed!

spwa4 • today at 10:11 AM

Luckily with AI, that has since increased to 100% with a small prompt ...

notorandit • today at 5:48 AM

The problem is the ocr, then.

_doctor_love • today at 3:19 AM

I don't need to read the article because the headline is true.

A mentor taught me that you can also roll your face on the keyboard to produce a valid Perl program. It's easy and fun to try!

➕ show 1 reply
NoMoreNicksLeft • today at 3:19 AM

I thought perl was finally dead enough people would stop mocking it. I'll wait til next decade.

➕ show 2 replies
kronks • today at 5:44 AM

[dead]

lakt42t • today at 3:57 AM

[dead]