Live data from Hacker News

93% of Paint Splatters Are Valid Perl Programs (2019)

mcmillen.dev

111–120 of 170 posts

Re: 93% of Paint Splatters Are Valid Perl Programs (2019)

#111
post #2

Sometimes I forget how insane Perl was before `use strict;` became commonplace.

use strict; has basically eliminated typos or variable-related errors for me. combined with -T, it's given me a lot of peace of mind, which I miss when using PHP. I'm seriously contemplating writing my own SetConst and GetConst functions. (Lately I've been finding a lot of sense in immutable variables.)

> combined with -T, it's given me a lot of peace of mind, which I miss when using PHP.

Try Hack? It's not too bad and the typing can be added piecemeal.

Re: 93% of Paint Splatters Are Valid Perl Programs (2019)

#112

Earlier quoted context omitted.

I’m sorry the code you produced made you so unhappy EDIT: verb tense changed

Any particular reason for the insult? I don't recall saying anything bad to you.

The deliberate misinterpretation is just a style of humor.

Re: 93% of Paint Splatters Are Valid Perl Programs (2019)

#113

Earlier quoted context omitted.

use strict; has basically eliminated typos or variable-related errors for me. combined with -T, it's given me a lot of peace of mind, which I miss when using PHP. I'm seriously contemplating writing my own SetConst and GetConst functions. (Lately I've been finding a lot of sense in immutable variables.)

> combined with -T, it's given me a lot of peace of mind, which I miss when using PHP. Try Hack? It's not too bad and the typing can be added piecemeal.

The main issue I have with Hack is that it is a big PITA to install. Like, there's no HHVM in ArchLinux repositories (or in no other distro's repositories either), and building it is super messy. That's also why I think almost nobody is using Swift on Linux.

Nobody is going to bother with your language when it's full out there of solutions as good as yours that people can install in one second.

Re: 93% of Paint Splatters Are Valid Perl Programs (2019)

#114

Earlier quoted context omitted.

Looked like a good-natured but wry joke, not a slap.

This whole thread feels like a glorious exercise of Poe's Law. I can't tell what's what, but man is it funny, to me it reads as deadpan humor by peterep with no insult intended, but obviously others read it differently. Perspective is amazing and this has made my day from all the smiles and laughs XD

Yeah, it's weird. Even aside from different perspectives, we still get to choose how to interpret and react. "Don't take it personally" is a good way to go through life, in general.

Re: 93% of Paint Splatters Are Valid Perl Programs (2019)

#115
post #35

Earlier quoted context omitted.

Reminds me of the joke: "Perl is the only programming language which looks the same before and after encryption."

please, perl ha nothing on q

q reads like prose compared to J.

Re: 93% of Paint Splatters Are Valid Perl Programs (2019)

#116

Earlier quoted context omitted.

Chris, we’re good. As others have pointed out, sometimes an edgy joke gets an edgy response.

Honest question. When did: use strict; Become more commonplace usage?

It started around two decades ago, but I would say the "use strict if at all possible or you're doing it wrong" consensus was reached at least as long ago as 2005, being conservative. Because backwards compatibility was always seen as paramount, it never became default, but if you opted into new version features by version number[1], those advanced to enabled both new features and to turn off or warn on use of what were considered problematic features in the code. For example, a "use v5.10;" pragma would warn indirect method syntax with the assumption you never wanted that (so any new Foo("arg"); would error, so people would use Foo->new("arg"); as the sane agreed upon way it should be done), and would disable bareword filehandles (so you would need to assign them to a scalar like $FH instead of FH).

use v5.12 and later also automatically enabled strict. Perl 5.10 was released in late 2007, and 5.12 in 2010, so there was enough consensus over a decade ago to add it as the default for anyone opting into the bundle of all newer Perl features.

1: https://perldoc.perl.org/feature#FEATURE-BUNDLES

Re: 93% of Paint Splatters Are Valid Perl Programs (2019)

#117

Earlier quoted context omitted.

One person’s tool is another person’s livelihood, the corner stone of their professional experience, and the basis by which other people will (apparently) judge their technical expertise

The comment that upset you made a joke about their code and the tools from the late 90s. It seems you took it as a personal insult as if they were directly talking to you or about your code. It is a really odd thing over which you to get defensive. I have no horse in this race and I would never judge anyone’s expertise solely on the tools they use (given that it might not even be their choice). But between the two of…

>The tools we use don’t define us. If you feel they do, please reevaluate. Perl (C, k8s, PHP, Python 2.x) are just tools. It’s like defining your identity by the brand of hammer you use.

Maybe they shouldn't but professionally they actually do. Try to get a job using a tool you love but doesn't have widespread adoption and it's hard. X years experience using tool Y? Better have got on board earlier. Adopt something early that really takes off while you write key libraries, docs, contribute (previous times o'reilly howto books) and it can make your career.

As a class we get awfully groupthink and boosterist of our tech choices. It's not good but it's completely understandable.

Hammers are completely fungible. Two similar languages used in similar places are not. See Perl and Python. Do you really have no preference seeing jobs that specify one or the other? If so that's great - I try to be thereabouts myself too. But it's clearly not the norm and it's not as irrational as you're making out here for all I dislike it.

edit: Trying to phrase this in a pithy fashion below.

It makes zero difference to you as a carpenter if every other carpenter on earth hates your chosen brand of hammer.

It makes a world of difference to you as a programmer if your language of choice is popular or not.

Re: 93% of Paint Splatters Are Valid Perl Programs (2019)

#118
post #99

In university, I learned Perl out of curiousity. It was the first scripting language I tried; I was only familiar with Java, C and Scheme at the time. After reading Programming Perl from cover-to-cover, I suddenly felt like I had superpowers. I probably would have felt the same if I'd taken the time to learn bash scripting, but that's not how it worked out. I tried to automate everything in my life with Perl. I'd wal…

That is what bash/pipeline programming felt like for me the first time I mastered it.

I missed the Perl boat by a few years, riding the Python2/Java wave at Uni instead, but I did encounter it a few times in legacy (read: 5-years old) code and could only marvel at its string manipulation capabilities.

I like to think of it as the extended bash that I never took the time to learn

Re: 93% of Paint Splatters Are Valid Perl Programs (2019)

#119
post #8

This is obviously just a bit of fun, but looking at the output examples, I think the OCR used may be flawed in that it's heavily optimised to produce characters used in natural language (alpha & spaces) rather than to produce e.g. operators common in code. The number of "special characters" output is extremely small. This will bias it heavily toward producing identifiers, which will be valid in most common programmin…

I don’t think that’s a flaw! The study is “95% of paint splatters” not “95% of random strings of ASCII characters”. If common OCR programs are optimized to produce letters and spaces, fair game! (You would of course want a “proper” scientific study to be more rigorous about these things.) Edit: Also, the programs in the article appear to be mostly special characters?

> I don’t think that’s a flaw! The study is “95% of paint splatters” not “95% of random strings of ASCII characters”. If common OCR programs are optimized to produce letters and spaces, fair game!

But if someone said "95% of paint splatters OCR as Welsh words" and it turned out that's because the OCR is looking for words, it doesn't say much interesting about Welsh like the title implies.

> Edit: Also, the programs in the article appear to be mostly special characters?

Look at the whole gallery though. Most of the OCR results are just a string of letters or a number. Those being valid is very mundane.

Edit: Actually if you want to make the analogy super precise, you could say "oh yeah those strings of letters are just proper nouns, which makes them valid Welsh, and of course numbers are valid Welsh"

Re: 93% of Paint Splatters Are Valid Perl Programs (2019)

#120
post #96

This says more about OCR than Perl... But any language that detects random string as a valid program is under suspicion of allowing more bugs than valid programs.

This. The stricter the compiler the more likely a mistake will be trivially caught by the compiler rather than be a bug that has to be hunted down in the output.

It may be easier to write in a language that isn't as strict, but it's going to take more effort to produce a *correct* result.

Post reply on HN