Live data from Hacker News

93% of Paint Splatters Are Valid Perl Programs

colinm.org

91–100 of 135 posts

Re: 93% of Paint Splatters Are Valid Perl Programs

#91
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…

> Perl6 was a reaction to Perl's loss of mindshare, not its cause.

True, but when your reaction takes 10 years, you lost a lot of ground. When perl6 was started perl was declining but still in serious use.

Re: 93% of Paint Splatters Are Valid Perl Programs

#92
Wonder what it would take to transform, as an one to one function, any random text into a syntactically correct program of any language. Off the top of my head, enclosing the text in a string literal would work, but are there more interesting methods out there?

Re: 93% of Paint Splatters Are Valid Perl Programs

#93
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.

> 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.

For quines, see the chapter "Air on G's String", a dialogue between Achilles and the Tortoise in Douglas Hofstadter's book GODEL,ESCHER,BACH: AN ETERNAL GOLDEN BRAID.

Re: 93% of Paint Splatters Are Valid Perl Programs

#94
post #62

Earlier quoted context omitted.

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.

Perl6 wasn't _released_ until 2016, though.

Re: 93% of Paint Splatters Are Valid Perl Programs

#96
For additional fun, try piping random characters into perl:

    $ chars='A-Za-z0-9!"#$%&'\''()*+,-./:;?@[\]^_`{|}~'
    $ 
Usually you'll encounter a syntax error, but sometimes it does execute without errors. Usually the successful ones are successful only because Perl finds an errant octothorpe and skips over all the other literal line noise after it.

Regardless, fun to know that

    L8vw>@ksSU
is a valid - useless, but valid - Perl program.

Re: 93% of Paint Splatters Are Valid Perl Programs

#97
post #51

The irony is that the readability of 93% of actual Perl code is equivalent to the paint splatters

The logic doesn't follow the other direction. It isn't a necessary condition. We're doing (93% paint splatter -> perl code) but that isn't equivalent to (93% perl code -> paint splatter). The first could be valid AND the following can be valid (0.1% perl code -> paint splatter)

Re: 93% of Paint Splatters Are Valid Perl Programs

#99

Earlier quoted context omitted.

mod_perl couldn't live safely on shared servers. You had to rent the whole box if you wanted to use mod_perl.

Not even mentioning the memory leakiness of it, it even had a module for tracking leaks: https://perl.apache.org/docs/1.0/guide/performance.html#Memo... https://perl.apache.org/docs/1.0/api/Apache/Leak.html

I have a lot of legacy code built on mod_perl that survived over five hardware generations without missing a beat. But mod_perl has become system-cripplingly leaky over the last couple years. I nearly entered a debug rabbit hole before considering a simple workaround. After a quick apache conf edit, mod_perl was swapped out for plain old CGI. Heresy perhaps, but everything is running smoothly again.

Re: 93% of Paint Splatters Are Valid Perl Programs

#100
post #51

The irony is that the readability of 93% of actual Perl code is equivalent to the paint splatters

The logic doesn't follow the other direction. It isn't a necessary condition. We're doing (93% paint splatter -> perl code) but that isn't equivalent to (93% perl code -> paint splatter). The first could be valid AND the following can be valid (0.1% perl code -> paint splatter)

Aren't 100% perl code -> paint splatters. For each code there exists a paint splatter i.e. image of the code itself.
Post reply on HN