Top
Best
New

Posted by zenincognito 14 hours ago

93% of paint splatters are valid Perl programs (2019)(www.mcmillen.dev)
482 points | 59 comments
snitty 13 hours ago|
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 13 hours ago||
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

tomhow 12 hours ago||
And others! Here's the full list:

93% of paint splatters are valid Perl programs (2019) - https://news.ycombinator.com/item?id=40197013 - April 2024 (124 comments)

93% of Paint Splatters Are Valid Perl Programs (2019) - https://news.ycombinator.com/item?id=27929730 - July 2021 (163 comments)

93% of Paint Splatters Are Valid Perl Programs - https://news.ycombinator.com/item?id=20834351 - Aug 2019 (7 comments)

93% of Paint Splatters Are Valid Perl Programs - https://news.ycombinator.com/item?id=19576425 - April 2019 (132 comments)

Someone 6 hours ago||
You missed https://news.ycombinator.com/item?id=38754686 (1 comment)

(Found by clicking the ‘past’ hyperlink leads me to https://hn.algolia.com/?query=93%25%20of%20paint%20splatters..., which gives me six results)

More interestingly, gnabgib reported a different number of comments, leaking the fact that they have showdead on (and you have it off)

adamrezich 13 hours ago||
The reply near the top of the 2021 link with the Master Foo koan hits quite a bit differently in the age of vibecoding.
layer8 13 hours ago||
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.
hyperman1 7 hours ago|
I've had a program where some R code stuffs some input in an URL, fires it at a server, then reads the returned CSV. No error handling or validation is attempted.

As it happens, basically anything is a valid CSV.

If the input is wrong, the server responds with an XML error. This got interpreted as a CSV. Every line became a record, but no column headers were found so every expected field is null/NA. All these nulls get nicely sorted and processed, which causes more string errors, etc ... Mayhem ensues when thst stuff ends up in a database.

hilariously 6 hours ago||
CSV is not a format, its a vague idea, https://www.youtube.com/watch?v=YrqSp8m7fmk - this is a great video on how to make it fast, and how its pretty bad
hyperman1 4 hours ago||
Can't agree more. I've dealt with a CSV where multiple CSVs were cat'ted together, but the originals were not in the same dialect and differed even in charset encoding. Wrote a statistics based parser that decided which part of the file had to be decoded which way. Interesting technical challenge, but my god the reasons for its existence were dumb.
xg15 41 minutes ago||
Falsehoods programmers believe about CSV: "Yeah, sure it's a mess and there are like, a gazillion different dialects of it, but at least once you know the dialect of a file, you can decode it"...
zenincognito 14 hours ago||
The actual paper is also highly entertaining - https://www.mcmillen.dev/sigbovik/2019.pdf
heresie-dabord 10 hours ago||
From the paper:

"An interesting thing about these images is that they’re not particularly Perl-specific; for example, the program shown in Figure −3 also evaluates as the number −3 in Python (and presumably several other programming languages.)"

We live in the age of Python, which I use every day. But I still also use Perl when it's the better tool for the job. And it often is!

Amorymeltzer 14 hours ago|||
In particular, I like "Figure − 3. − 3 ." as a good little easter egg.
0xbadcafebee 12 hours ago|||

  The remainder of the valid Perl programs are mostly valid due to a Perl
  language feature that is not commonly present in most programming languages.
  Namely, Perl has a feature called “unquoted strings”, in which a sequence
  of alphanumeric characters by itself is parsed as though it were a quoted string.
  As an example, Figure 5 is read by OCR as the text ME, which evaluates to the
  string “ME” even though the ME isn’t quoted. This would result in a syntax
  error in most other programming languages.

  (To be fair to Perl, when perl is run with the -w flag to enable warnings, it does
  helpfully inform the user that at some point in the future, the Perl developers
  will most likely pick gggijgziifiiffif as a new reserved word:
      Unquoted string "gggijgziifiiffif" may clash
      with future reserved word at - line 1.)
xhrpost 11 hours ago||
So they might be valid older(<v5?) PHP scripts as well?
Izkata 6 hours ago||
PHP 5 had unquoted strings, and it looks like 7 did as well, but not 8.
comboy 4 hours ago|||
For those who do not enjoy reading scientific papers this one is worth reading.
rurban 3 hours ago||
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 9 hours ago||
I’m more interested in how the OCR missed that ‘Stitch & Shutter’ watermark in the third one.
michaelt 4 hours ago||
It looks like the author used Tesseract, a traditional OCR image with lineage going back to HP flatbed scanners in the 1980s [1]

Obviously, it's been improved a lot since then - but traditional OCR is mostly about black text on white backgrounds. Or at least, the text being high-contrast relative to the rest of the document.

Light gold text on a white background, while there are black splatters? That's the sort of thing it would struggle with for sure.

[1] https://static.googleusercontent.com/media/research.google.c...

bozdemir 8 hours ago||
Hahahhahah good catch.
baron3dl 12 hours ago||
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 11 hours ago||
A whole new twist on "Hackers and Painters"
jacquesm 12 hours ago||
Someone should reverse that and see how many paintings can be made to execute as Perl and what those programs do when invoked.
kmoser 11 hours ago|
You could kill two birds with one stone by entering them in the Obfuscated Perl Contest, were it still being held.
mlmonkey 9 hours ago||
Every single day there's an Obfuscated Perl Contest being held somewhere on this planet....
isolay 3 hours ago|
> fruitful procrastination

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

More comments...