So, I've always heard Perl is a bad language, write only etc. I've recently learned it, and now I can write some serious Perl. And you know what? I like it. It's not elegant as Haskell or clean as Python, but if you know it well you can make it elegant and clean.
Actually, I like it more than FIOC. And Python used to be my preferred language! In a sense it's like a reverse Randal (see https://xkcd.com/353/ alt text).
So, some people think Perl is in decline, being replaced by more modern languages. [citation needed].
What do you think of this? Is there any Perl lover here who can tell me it's not gone? I want Perl among us for years to come.
Can we has it?
Name:
Anonymous2015-09-09 15:46
Perl is better than most scripting languages, and now perl6 is out.
I'll say this up front: I've not used perl very much, I've probably written about 100-200 lines of it tops. But from what I've seen of it, I'm not very fond of it. It has no formal specification (unless you want to argue that the implementation is the spec, in which case it has an exceptionally poor spec that conflates implementation details with semantics and changes every time someone makes a commit), its syntax is ambiguous and parsing is undecidable. It just seems like this massively complex project in general, and that even to do simple tasks you must keep a lot of it in your head. I'm more than willing to consider the possibility that this is all wrong, and perl is actually a wonderful language that can solve many important problems in a unique way that is (by some metric) better than many other languages, but alas, I have not seen any evidence to this (although I haven't exactly gone looking either).
the only thing good about perl, is you can still do procedural programming (subs) without requiring complex OOP messes. But that's as good as perl gets, everything else about it encourages poor code. In perl, people don't learn how to parse, they learn how to use regexes. Regex does not equal parsing. Every person should educate themselves on how to char by char parse with C language or something similar. PHP has similar problems - everyone uses regexes when more elegant parsers would solve the problem. If the wikipedia source code was rewritten properly, it would have a parser, instead of unmaintainable regex after regex.
Name:
Anonymous2015-09-14 19:59
>>14 Not every text mangling app needs a parser, though Perl 6 grammers make it a lot easier in those cases where you do.
regexes and perl solutions are good for quick one off hacks, but try looking at the wikipedia source code which uses perl style regex code in PHP - please tell me the wikipedia source could be written better. Seriously, download the wikipedia source code and have a look. It's hideous. Perl 6 and PHP and Ruby make it easy for people to write bad code. Although, even in plain C you could still import a regex unit in your C code and abuse them too.
What the fuck are you talking about? Perl 6 shits on PCRE.
Name:
Anonymous2015-09-14 20:55
>>17 Go ahead, try writing a parser for wikipedia in perl 6 and compare it to a parser written using a Case/Switch parser that increments the character one at a time. The case/switch C based parser will be much easier to maintain than perl 6 hodgepodge. But if you've never written a real parser in your life and you think that "PERL is parsing", you'll never see the light. It's hard to unbrainwash a perl programmer since they think about parsing in that sort of way, as they've never educated themselves that perl itself was just written in C, not perl. Since perl is so good for parsing, you'd think perl would be written in perl, similar to how nimrod is written in nimrod, Golang is written in Golang, ... it's called eating your own dogfood.
"Pugs is an implementation of Perl 6, written in Haskell. "
LOL an academic haskell user writes a compiler for a non academic language thought up by a young earth creationist...
"If God is creating the universe sideways like an Author, then the proper place to look for the effects of that is not at the fuzzy edges, but at the heart of the story. And I am personally convinced that Jesus stands at the heart of the story." Larry Wall
>>22 A usable Perl 6 beta was supposed to be available by October 2002. It would have been ready by now if they didn't choose to implement it in a toy language.
Name:
Jesus Freak2015-09-14 22:26
indeed it was perl 5 that was written in C, if perl 6 can bootstrap itself this is somewhat good news that it can eat its own dogfood... But at the same time, this doesn't guarantee in any way that the perl 6 written in perl 6 is maintainable 5 years down the road when some Evangelical christian programmer goes to heaven after getting hit by truck, and can no longer offer support services for his perl6 compiler.
There are people who think that parsing text character by character with C is somehow more elegant than a beautiful one line regex? What a world we live in.
Name:
Anonymous2015-09-15 0:57
>>28 Regexp are weak cunt-grade finite automata crap. It can't even parse the Dyck Language. C, though, is a top-of-the-line Turing complete machine that can mow down any problem that can be mowed down hundreds of times faster than lame regexp.
Name:
Anonymous2015-09-15 1:01
>>29 I wrote a regex engine in C when I was 12 years old.
Name:
Jesus Freak2015-09-15 1:13
regex requires reparsing the string over and over again, char by char allows you to do it in one basic pass.
Name:
Jesus Freak2015-09-15 1:18
note: you can do char by char parsing in almost any programming langauge, but perl encourages you not to. I've seen char by char parsers in PHP, but 99.999 percent of lame php programmers use php regexes for parsing because they've never been educated on what parsing actually is. They think parsing = regex.
Name:
Anonymous2015-09-15 1:23
>>1 Perl.."but if you know it well you can make it elegant and clean."
Famous last words. This is what it says on Larry Wall's tombstone in the future "I swear, if people just knew how to use perl properly, they could have made it clean and elegant! it's not my fault!"
Name:
Anonymous2015-09-15 1:33
100 lines to implement something a regex can do in 1 line because you want to avoid the overhead of reading a single character twice
Name:
Christ Our Lord2015-09-15 2:40
>>34 try adding new features to your regex driven parser... oops ... go and download the wikipedia source code for wikimedia php, try modifying the source to add a new feature. Which regex do you modify, and does that introduce a 100 new bugs into the program. Try it. If you've never looked at the wikimedia source code, it's time. Too clever for your own good comes to mind - people who think up these regexes are brilliant fools, something like an aspergers child who invents brainf&ck only to realize that brainf*ck doesn't actually help society, even though it took great skillz to think up such a joke.
Name:
Anonymous2015-09-15 2:57
>>1 It's not an opinion that perl is being replaced by other languages, it is a fact. Try finding a company that is looking for perl devs. Good luck with that. Perl is fine for small projects but it does not work nicely in large scale enterprise environments. Remember kids, readability and maintainability are one in the same, and maintainability is very important to businesses. It is true that you can write beautiful code in perl but it is also true that you can write obfuscated-tier code in perl. At any given time at my company 10 to 15 devs can be working on a single milestone. Try getting 15 devs to write clean perl. Good fucking luck with that.
A lot of companies in silicon valley are doing all they can to increase productivity and decrease the bus factors for legacy code. For instance, the MVC design pattern was great during the early web 2.0 era but they realized it didn't scale well in large team environments so they invented MVVC. Eventually that won't be good enough and they'll move in the direction of naked objects.
OP, you need to stop thinking like a small timer and look at the big picture. Once you work at a large company and unlock level 3 pay like me you'll understand that perl was a mistake. Perl was created by a god fearing liberal who couldn't into bash. What is shell scripting?
Name:
Anonymous2015-09-15 3:09
>>36 To follow up. Employers are looking for the following languages in this order: 1) PHP5 2) Java 3) Javascript/Nodejs 4) C# 5) Ruby/Rails 6) C/C++ 7) Python ... ... ... x) Golang y) Perl
Even Golang is more popular than Perl these days.
Name:
Anonymous2015-09-15 4:29
>>37 So? ENTERPRISE developers may not have to write applications in perl, but that doesn't make it worthless. That's like saying shell scripting is worthless because no sane businesses write their websites in it.
Name:
Anonymous2015-09-15 4:32
>>35 Are you seriously saying adding features to 1000 lines of spaghetti code written to parse text one character at a time is easier than modifying a regex? IHBT
Name:
Lord in the Sky2015-09-15 4:47
>>39 modifying a single regex, is that all you think it takes - please download the wikipedia mediawiki php sources and modify one regex to change the behavior of mediawiki - you've just introduced 123 new bugs because you don't know what side effects that regex has if you slightly modify just one character in the regex. Blow up your house by changing * to A.. booM BooM bOOm... char by char parser doesn't blow up as easily because you have to know what you are doing. Regex allows idiot monkey programmers access to computers - ever since these idiot monkeys got a hold of php and perl, they created junk like mediawiki without proper parsers that were *well thought out*
Name:
Lord Jesus Himself2015-09-15 4:49
>>37 "To follow up. Employers are looking for the following languages in this order: 1) PHP5 2) Java"
Grabs gun and shoots himself... Java and PHP... Vomit, Vomit, Vomit. Uriel is gone, for what reasons again?
Name:
Adam Tells Eve2015-09-15 4:54
perl == php two of the same jokes. What's the difference between perl and PHP? Nothing, they both start with "pee"
>>40 dude just post some relevant source already instead of saying that we should go read it. I'm not going to read PHP in my fucking spare time asshole.
Posting the wikimedia source code, would blow up this website with bloatware regex that exploded your brain into &*#@! Go download the wikimedia source, and ask yourself, could they have engineered this better - could they have programmed this better, by using a maintainable parser.. case, switch, case, switch, case, switch, increment++ case, switch Call Procedure, analyze substring, increment, get_next_char(),
^ eat Dick - Eat Richard Stallman - Dick, Stall. Man.
Name:
Anonymous2015-09-16 0:46
>>48 OH WOW LE 42 LE REDDIT XDDDDDDDDDDDDDDDD LE ah fuck this and fuck you and your stupid fucking le science man wow universe 420 hitchhiker book that nigger idiot britshit author and snigger idiot followers like you
>>53 An evangelical christian like the perl author uses references such as adam and eve to spread the word of Christ, almighty. Some of us know very well that this is just a lisp program that stallman wrote in 1984 and string theory = lisp theory.
Name:
Anonymous2015-09-16 1:19
>>54 If it was string theory, it would be Perl. G-d said so Himself.
it's much easier to send signals down a wire through time than it is to send a full physical grey via a spaceship
Name:
Reptilian2015-09-16 6:13
>>58 You are going to get probed so hard you stupid little earthling.
Name:
Anonymous2015-09-16 17:35
I kisses a Perl and I liked it.
Name:
Anonymous2015-09-16 19:46
>>59 Careful you're not talking to a grey, the cards may be reversed.
Name:
Anonymous2015-09-17 18:57
### Containers # In Perl 6, values are actually stored in "containers". # The assignment operator asks the container on the left to store the value on # its right. When passed around, containers are marked as immutable. # Which means that, in a function, you'll get an error if you try to # mutate one of your arguments. # If you really need to, you can ask for a mutable container using `is rw`: sub mutate($n is rw) { $n++; say "\$n is now $n !"; } (from http://learnxinyminutes.com/docs/perl6/ )
Perl 6 is the next big thing. Just installed rakudo and played a bit with the REPL, it's pretty good!