Live data from Hacker News

93% of Paint Splatters Are Valid Perl Programs

colinm.org

111–120 of 135 posts

Re: 93% of Paint Splatters Are Valid Perl Programs

#111
post #63

I miss Perl. Why did PHP win again, in the late 90s? (though I'm mostly Python these days and shan't complain, there was a good 10 year stretch of PHP there I'm not proud of).

PHP won because you just wrote the code and it worked. With Perl you had to deal with the cgi interface which was a pain. Mod_perl came later. PHP was just extremely easy to get started with — you did t need to really understand Perl modules, the cgi spec, or anything to get started with it.

I gave up on PHP around 1.8b6 or something like that. However, before mod_perl arrived, I have used Perl to generate PHP code: a minutely cronjob would read the database and generate the PHP code with the right pulldown values from the database. It was the best of 2 worlds: a sane programming language and fast (non-CGI) execution.

Re: 93% of Paint Splatters Are Valid Perl Programs

#112
post #36

Because of the frequency I see undecipherable strings like this in actual Perl code, I don't like Perl the programming language. However, I love Perl the project. Take a look at the config file for Perl and how many systems and architectures it accommodates: https://github.com/Perl/perl5/blob/blead/Configure It's clearly such an incredible labor of love by Larry Wall et al. that I'm sad for them it isn't more popular…

> It's clearly such an incredible labor of love by Larry Wall et al. that I'm sad for them it isn't more popular. Just a mammoth amount of work by nice, passionate people.

That would even more fittingly describe Perl 6.

For some reason, there seems to be a complete lack of toxic behavior in the Perl community (both 5 and 6).

Re: 93% of Paint Splatters Are Valid Perl Programs

#113
How can one grab the output? The following (first line) saves nothing to the file as is seen in the second line and with the program in the third line:

~$ ./perltest | tee output.txt

~$ cat output.txt

~$ cat perltest

#!/usr/bin/perl

eval(";i;c;;#\\?z{;?;;fn':.;");

Re: 93% of Paint Splatters Are Valid Perl Programs

#115

Earlier quoted context omitted.

The part that left my office in stitches: > (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.)

Knowing Larry, I believe he is currently working on a patch.

Larry left perl5 about 15 years ago, and nobody every will reserve random keywords like this. Keywords are very problematic in perl5 and are not needed all. You can add random new keywords at runtime, and you can add methods doing almost everything, like accepting blocks or functions, implementing most control structures.

Re: 93% of Paint Splatters Are Valid Perl Programs

#117
post #108
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.

And then someone else tries to read your code. One of the things I love about ruby dev is its not about providing 10000 ways to do the same thing but about making sure that given a simple problem, every developer will solve it in pretty much the same way.

What? With ruby, there are at least 4 ways to find out how big something is (.size, .length, et al). You want to loop over something? You can use python style for in loops, .each, and several other ways. Your block could be a block, or it could be a symbol with an & in front. Want a bit of code without a name? You have blocks, procs, and lambda. Want a string? You have string and symbol, and ne'er the two shall cross paths.

Ruby is specifically designed as a replacement for perl, and keeps a lot of the same warts ($igils, and globals like $?, $1, etc). While I agree it's better than perl for readability, it's not because there's only one way to do any given thing.

Re: 93% of Paint Splatters Are Valid Perl Programs

#118
post #108
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.

And then someone else tries to read your code. One of the things I love about ruby dev is its not about providing 10000 ways to do the same thing but about making sure that given a simple problem, every developer will solve it in pretty much the same way.

Are you crazy? I explicitly dislike ruby because I feel it encourages everyone to make their own DSL like bullshit wrappers everywhere - Leading to a million and a half ways to do anything and everything.

While I don't use it often, I feel like GoLang at least vaguely tried to adopt a "single solution" approach to language design. They keep the standard library as compact as possible, and formatting is non-optional with gofmt.

Re: 93% of Paint Splatters Are Valid Perl Programs

#120

Quite against my better judgment, I've made the transition from Perl-hater to Perl- er... -tolerator. I found myself arguing yesterday with another person in the team about the proper use of Perl references, which I cursed and spat on for 2 days when I first had to use them. I once read that my current position mirrors that of most Perl users. (my boss has a self-confessed "irrational" hatred of Python because of sem…

I kinda agree with you boss. I don't hate python, but I find semantic whitespace both tyrannical and error prone. Interestingly, Makefiles also have semantic whitespace, which seems to be much more commonly despised than python's.
Post reply on HN