Live data from Hacker News

93% of Paint Splatters Are Valid Perl Programs

colinm.org

81–90 of 135 posts

Re: 93% of Paint Splatters Are Valid Perl Programs

#81
post #19
post #10

I love this footnote so much: > This feature does enable a neat quine: the Perl program “Illegal division by zero at /tmp/quine.pl line 1.”, when saved in the appropriate location, outputs “Illegal division by zero at /tmp/quine.pl line 1.” The reason for this behavior is left as an exercise for the reader.

It's trying to divide "Illegal division by zero at /" by "tmp/quine.pl line 1." and "tmp/quine.pl line 1." evaluates to 0?

It is slightly more complicated than that :-) https://fanf.dreamwidth.org/131318.html

the actual parse is

  division->Illegal(
    zero->by(
      ((“at” / “tmp”) / “quine”)
       . line->pl(1.0)
    ))

Re: 93% of Paint Splatters Are Valid Perl Programs

#82
post #62

I wonder how much of Perl's decline can be attributed to the Duke-Nukem-Forever-tier delay in releasing perl6. It seemed like so much of the web ran on it in the late 90s and early 2000s that it would have at least as much traction as PHP does today.

Perl6 was a reaction to Perl's loss of mindshare, not its cause. One can speculate what might have happened if focus had been put on evolving Perl5, or getting Rakudo production-ready as-is instead of going through yet another round of 'tinkering' (eg making the compiler backend-independent, the New Object Model refactor, creation of MoarVM, the Great List Refactor, ...) - however my crystal ball seems to be broken a…

> The design process for Perl 6 began in 2000

I don’t remember Perl losing mindshare around that time; quite the opposite.

Re: 93% of Paint Splatters Are Valid Perl Programs

#83
post #39

Earlier quoted context omitted.

Perl gives you as much rope as you want to hang yourself. If you can develop a style, and try to avoid being too clever, it can be just as readable as any other language.

The best languages sacrifice readability the least for a given amount of cleverness.

You just described Tcl. :-)

Re: 93% of Paint Splatters Are Valid Perl Programs

#84
post #77

I recently wrote a little program that will create a Markov Chain from on our perl codebase, generate a few sentences and check against `perl -c`. It takes less than 10 attempts to generate a bunch of lines of [very funny] valid Perl code.

Hey! I did that too! Except my version ran the Markov chain against its own source code, which was padded with a bunch of meaningless subs that did were never called but were valid code. It also ran in an infinite loop, which worked well. I had to kill it after a few minutes because I was afraid it would start running shell commands.

And the terrible truth is this is how we got skynet.

Re: 93% of Paint Splatters Are Valid Perl Programs

#85
If you never worked in perl, you might think people are being a bit mean and want to take a contrarian position. It really was that bad. You'd come back from lunch and need to pull out a notepad and start diagramming to understand the code you are written an hour earlier. The only language I've ever seen, outside of joke languages like brainfuck, where the typical program was less readable is APL.

Re: 93% of Paint Splatters Are Valid Perl Programs

#89
post #65

> Also, ImageNet’s website was down on the day that we decided to perform this research. We therefore paid an unemployed person to download 100 examples of paint-splatter artwork by searching Pinterest using the query “paint splatter wallpaper”. Such brutal honesty would be welcome in other papers.

The author recently quit Google[0], so I believe he's unemployed. I think that's the joke (also, he really likes his memes). [0] https://mobile.twitter.com/mcmillen/status/10863837264504053...

There's a footnote on "unemployed person" with the text "the first author."

Re: 93% of Paint Splatters Are Valid Perl Programs

#90

If you never worked in perl, you might think people are being a bit mean and want to take a contrarian position. It really was that bad. You'd come back from lunch and need to pull out a notepad and start diagramming to understand the code you are written an hour earlier. The only language I've ever seen, outside of joke languages like brainfuck, where the typical program was less readable is APL.

> You'd come back from lunch and need to pull out a notepad and start diagramming to understand the code you are written an hour earlier.

I think this says more about your skill level in programming Perl or programming in general at that time than it does about Perl. Or at least the influences that you learned Perl from.

It's possible to write nearly unreadable code in any language. It's easier to do so in Perl, since it's pretty freeform. It's also not that hard to write very clear code. But you're complaining about your own code. I think perhaps blaming the tool at that point is looking in the wrong place.

Post reply on HN