Ask HN: Why hasn't Perl 6 taken off yet?
I am new ish to perl, coming from Python, and absolutely love the language and the community! I've been poking around perl 6 and it seems even cooler! It has everything I want: gradual typing, multiple paradigms, an up and coming package manager, and a nifty logo.
So, why isn't it the poster child of the scripting languages yet?
280 comments
[ 6.0 ms ] story [ 267 ms ] threadIf I had to guess, ‘foo.IO.words’ probably turns ‘foo’ into an IO object of some sort and then reads words. (Whether it reads the whole file into a string and splits that into words, or if it just reads the next word generator/iterator-style is not especially relevant.) An error throws an exception, like it would in Python or Ruby ‘open('dict.txt')’.
Also I kinda doubt that ‘loop over lines and split them into words’ is more readable than ‘.words’ which presumably does exactly what it says on the tin.
A word is probably defined by either \b or UAX #29. (And since IIRC one of the goals of Perl6 is good support for Unicode, \b hopefully uses the word boundary algorithm in that appendix.)
It's a bit of a trap, I agree and we should fix it. Having all exceptions listed is on the list and will add another few hundred man hours to the nearly 5000 we invested in the docs so far.
If you really want to be verbose you can always write `open('foo.txt', :r).Str.split(/\W/)`. If you learn a new language there will be buildins that are well tested and may be more efficient then your solution (it isn't right now for your example. Rakudo does it exactly your way). It can be worth your time to learn what the standard library provides you with -- in any language that is.
The lack of feedback from actual language users did slow down Perl 6 development and esp. getting all the holes in the docs plugged.
What is that? It certainly isn't Perl (5 or 6).
The logo is cute, I will say.
Again, this is my own personal opinion. I know many people have made some great software based on Perl, but it's the only language I won't touch with a 10 foot pole, and I've spent a couple of years programming in PHP and a year in COBOL.
|| has a higher precedence than or in Ruby as well.
But ruby was a quite a happy move for me back then in 2006, language was underperforming, features were lacking, nowhere anything like CPAN, but I could express logic much closer to how I think about problems, without additional layer of "thought translation".
I've seen some expensive boo-boos due to operator precedence mistakes (e.g. - in C)
That said, there are a lot of special variables that can be tedious to figure out (e.g. - $" vs $;), if somebody uses the less frequently used ones, rather than the long-form names.
I can remember $_, $? and $!, but that's about it. And I like Perl.
The rest were either just abandoned or given names such as $GROUP or $PROGRAM-NAME
$/ isn't the same as it was in Perl 5 instead it is for storing the result of successful matches. ( you can also assign to it )
$0, $1, $2 is short for $/[0], $/[1], $/[2] $<abc> is short for $/{'abc'} which can be spelled as $/<abc>
Many years ago, I had a bookmark in my C manual (Harbinson Steele) for the operator precedence page.
After a while I removed that bookmark. I decided that if I needed to look at that list, I should use parentheses. :-)
> who knows :|
> It Just Is.
> remember, perl is a memory competition
There is a LOT to remember about how Perl works.
1. PCRE copies the Perl regex syntax almost completely (except some much newer cases than \A and \Z). See e.g. http://www.rexegg.com/regex-quickstart.html for \A, \Z, \z
2. If you check http://perldoc.perl.org/perlre.html then:
Edit: You might want to note that the regexps are redone quite extensively in Perl 6 and to a large part replaced with grammar for those use cases.It _is_ a memory competition though. In the various languages I've learned, Perl feels like it has the most to remember about how things work or interact (ymmv of course, I'm speaking of my experience here).
Expressive is the good side of this. But you really need to have coding standards in place.
On this subject, to upgrade to Perl 6 will be a bit scary, like driving a much faster car. :-)
6 Looks just fine as a language, but it really does feel like a completely new language which means it's less a migration and more a re-write. Which then leads to the question: if we're going to re-write, should it still be Perl?
And I'm not touching the "Perl 6" naming discussion.
There is inlining for using Perl 5 libraries in Perl 6, which smoothen the road. But it is a hard start to motivate projects in a new language, which is incrementally better. I would be happy to try.
Just because both slots are filled with the same "value" in perl, doesn't mean it's _not_ a dualvar. It's just a side-effect of the way scalars in Perl work.
It don't happen to me often, but I sprinkle "+ 0" and so on, without thinking about it.
The ASCII table used to be the alpha and the omega. :-)
That is, it was not so much of unnecessary extra detail when the char codes was inserted into Reg exps. The newfangled Regexps and grammars of Perl 6 cleaned out a lot of lint.
You could probably make an argument for starting to remove, not only add, [more] features when you declare a perl version in a script.
(And personally, I only ever used \n, \r, \t and similar. Everything else is as Cthulhu meant it to be, octal. Regular expressions' problem always was readability, I never used more features than I need and /x is my friend. That said, the "modern" Perl 5 regular expressions are like grammars, really cool.)
This one is useful. Remember that Perl was created for being a more powerful kind of shell.
Those operators have their precedence set so that you'll use || as a logical operation inside a command, and "or" for control flow between commands. The same is true for && and "and".
Perl says "there's more than one way to do it"
Python, by contrast, says "There should be one-- and preferably only one --obvious way to do it."
The practical outcome of the Perl philosophy is that Perl code can be extremely varied to get the same thing done and therefore much harder for different programmers to understand and maintain. Python programmers are more likely to quickly understand the intent of a chunk of code regardless who the author is.
Perl at its worst can also be pretty arcane and I've heard it described as "executable line noise". That doesn't make for maintainability.
> Yes, sometimes Perl looks like line noise to the uninitiated, but to the seasoned Perl programmer, it looks like checksummed line noise with a mission in life.
edit: formatting
I moved to Python for a later project (a custom CI system) and while there were people of varying skill working on it, the code looked the same because of the "only one way to do it" philosophy. Similar formatting, same idioms, readable code etc. This alone justified moving to Python for me. I could fix a problem in about a tenth of the time I needed to fix a similar bug in the perl codebase.
A huge part of this is due to the bad coding practices and relative inexperience of the programmers on the perl project. However, my feeling is that, perl is forgiving when it comes to style. It allows a skilled used to create really beautiful programs but pays the price by allowing terrible programs by bad programmers to run sufficiently well. We compared it to English. Very flexible, very forgiving when it comes to grammar and syntax if your intention is just to convey meaning.
(as far as I know, Python doesn't give you an error message when your function gets up to 66 lines, or whatever, long)
But, in my experience, because of the limitations on how flexible the language is, a 3000 line python function which is edited by multiple people is usually more readable than a 3000 line perl one.
(As an aside, you can make it more horrible because you don't even need a "run" function - just stuff it into the *.py file and it'll get executed :) )
Maybe a better question is: what makes 3000 lines single-function code so prevalent in Perl?
There's something to say about Perl 5 making function arguments difficult. But I don't think it ends there, because other languages attract the same kind of code.
YMMV, as they say.
This attitude is not very good in corporate environments where all code produced must be uniform so that new people can come and go and the software keeps churning out money.
Contrast this to Python which is a much more enterprise-y language, which is the reason for its success.
you mean, like string interpolation? :)
- Most perl developers moved on long ago. My last 3 bosses were all "perl" people who switched to Ruby as their primary language around 2010.
- No strong argument that perl 6 is "best-in-class" for any particular type of problem. This is often what brings interest in new languages (Go, Elixir, and Rust for example, all have this).
For most people the Unicode handling isn't the main problem they're solving, and most languages are more or less good enough now.
Yes, every other language has flaws on Unicode handling. But those flaws persist exactly because they are not important.
It's been I long time I don't write a "Unicode handling" application, yet the only environment where I ever got problems with it on the last decade was .Net. And it was a very small problem, worked around in less time than I've lost on this HN page.
"Please note: This announcement is not for the Rakudo Star distribution[^2] --- it’s announcing a new release of the compiler only. For the latest Rakudo Star release, see <http://rakudo.org/downloads/star/>."
Perl 5 is much more straightforward. Their download link sends me to a page where I click my platform and then there's a link to "download latest stable version." Why can't I just download the latest stable version of perl6?
I know I can spend a couple of hours learning more about it but perl 5 more than meets my needs and I'm comfortable with it.
As an outsider, my 2c is "abandon 'perl 6', too much baggage for reuptake, and go with Rakudo, which is a more modern name". People smarter than me decided on this rakudo/perl 6 nomenclature split, but it just feels like an own-goal to me.
https://en.wikipedia.org/wiki/Rakudo_Perl_6
Languages are a specification and implementation. Perl's been implemented in Rakudo, which runs on MoarVM and the JVM. It's handy being able to run on multiple VMs so that you can take advantage of their strengths, and in particular, places that deploy the JVM for Java will be simpler to integrate with, and apparently you can do stuff across with Java libraries even, though I haven't played with that at all myself.
http://rakudo.org/how-to-get-rakudo/#Installing-Rakudo-Star-... that's how I get it. Rakudo::Star is just a bundle of Rakudo with a bunch of commonly used modules which can be handy to have already installed.
Right now you get your choice of MoarVM or JVM to use as the tie into your OS, and MoarVM gets selected by default. It's started showing up in Linux distributions now too.
But yeah, I'm still a lot more comfortable in Perl 5 too.
Also, there aren't hat many libraries in its ecosystem yet, a thing which can be a plus for devs who want to create a name for themselves in the open source world by implementing/translating libraries with a large user base potential.
So when you look at a language and ask why it isn't popular, the answer is probably not that it's bad or that it has terrible features or that it's missing things every other language has.
Instead, the relevant answer is some combination of timing, marketing and luck—and Perl 6 definitely flubbed the first two!
It's been, what, two decades since Perl 5 first came out? In that time, trends have changed, people's preferences have shifted (and ossified) and even the role of a scripting language is different. And Perl 6 is not making any of that up on marketing, niftly logo notwithstanding: the Perl brand has been pretty well tarnished over the past years which makes these the absolutely wrong coattails to try sliding in what is supposed to be a brand new language.
None of this, by the way, shows that Perl 6 is a bad language. That's a different discussion entirely—a discussion in which popularity plays a small role at best.
But it is to say that I'm not all that surprised Perl 6 hasn't gotten anywhere.
They should drop the name Perl altogether and go for Rakudo IMHO
That would be a great idea. Inside the Perl community, everybody is already invested in Perl 5, and Perl 6 is just too different. Outside the Perl community, nobody would want to be found dead with anything called Perl. If Perl 6 is sufficiently better and sufficiently different, releasing under a new name would make a lot of sense.
A cousin of that problem is it doesn't matter how many years ago "Modern Perl" was written, today MySQL still doesn't support transactions.
Not a non-sequitur, in that to this day you'll still run into people swearing mysql doesn't support transactions because last time they looked into it in '94 it WAS true, mysql didn't add transaction support until the late 90s IIRC. Likewise its a law that all Perl discussions ignore everything that's happened in Perl development in the last 20 years. If no one has written code like that since '96 it just doesn't matter to the discussion.
But more importantly, NOBODY I know and rate has come to me and told me "You know what? Perl has moved on, it's actually become a wicked language, you should give it a shot". Whereas that has happened to other languages that I had given up on (ActionScript, JS, PHP) and I had no problem going back to them.
As for MySQL, seriously? Are there people who think that in 2016? I find it hard to believe. One thing is a programming language, but for a RDBMS it's just a matter of time before all the feature developer wants get added. With MySQL it's just a matter of "so what's version is it now, have they added them yet?"
Yet, as a previous Perl 5 programmer that abandoned it when better languages got powerful enough... How can Perl ever fix it's image in my head, so I'd take a deeper look at it and evaluate this new language?
I don't know the answer here. But there are a few things I know. What normally makes me look at languages is a combination of:
- Competent people recommending it. (This one is keeping open to learning Perl, but it's still not recommended enough for me to stop and learn it.)
- Unique new features. (Stuff that are in no other language. I don't see many for Perl)
- Community and ecosystems. (Those will drag me into a language, instead of leading, but they do make me look. Again, Perl has nothing here.)
So, Perl 6 has a bit of one of those, and it may be unable to ever get anything more. If for not other reason, because of bad standing image that won't attract many competent people for recommending it. I'm not convinced it will ever get anywhere, whatever is the actual language quality.
It's also perfectly possible that it does not add much value and I shouldn't mind learning it.
And there's a lot of effort required to discover what of those is true.
Six years ago I got into a flamewar on Hacker News about Perl 6 not being done yet and had to clarify to an angry Perl hacker that by "not being done", I meant, "as of 2010 we only have an incomplete implementation of a draft specification of the language".
More like it took 14 years for the first attempt (Parrot) to be abandoned, and about a year for the second attempt (MoarVM) to be somewhat usable, but still not really production ready.
To the OP it's quite simple - Perl 6 isn't done yet, it's still in development.
People use this as a negative all the time, or as "the reason" it hasn't picked up, but the rules of software dev are simple: ship fast, ship efficient, ship cheap -- pick two. It's FLOSS, so one choice is already made: ship cheap. Glad that Perl 6 went with efficiency over getting to market quickly.
Spend some time with the language and then go find me anything that comes close to covering the same number of programming paradigms, let alone the coverage of the standard library, then tell me that it missed its shipping target.
tl;dr -- 15 years after it started and it still manages to be more featureful than anything else out there.
Ruby is probably the main reason Perl lost so much market share, since it took a lot of the underlying philosophies from Perl and turned it into a beautiful, easy-to-read language.
> turned it into a beautiful, easy-to-read language.
and got annoyed (presumably?) that Python wasn't mentioned, but you completely ignored:
> it took a lot of the underlying philosophies from Perl
Ruby is a lot closer to Perl than Python is, which is what the draw would be for people migrating away from Perl.
I kept writing quick throw away text processing scripts in Perl until a few years ago, when I started to forget how to write the basic constructs due to lack of use. I'm writing them in Ruby now but I think that Perl was better suited to the task. At least I can read the Ruby ones years later.
But am I giving a try to Perl 6? No, I don't even know how it looks like. What problem would be solving for me? Who else is using it and for what? Can I go to a customer and say let's use Perl 6 for this project, don't worry you'll find many other developers to carry on development if I won't be available anymore? Not yet.
In the Perl6 community there is no equivalent of "The Python Tutorial" [0] or the "Python X.Y.Z documentation". From Python 1.X onwards, if you wanted to learn Python from scratch, this is where you started. Where is this in Perl6 version that assumes you start from scratch without having to learn the baggage of PerlN? [3]
[0] If I'm wrong loot at this: https://docs.python.org/3/tutorial/index.html and point me to the Perl6 equiv.
[1] https://docs.python.org/3/
[2] where N < 5.X
https://docs.perl6.org/language/rb-nutshell
An overview of the differences between Ruby and Perl6, which doesn't seem to assume Perl5 knowledge, but beyond that the docs are a bit lacking on the tutorial front. (and personally they seem a bit lacking on the polish side of things too. They seem like they could benefit from a some better organization.)
Bulgarian: http://bg.perl6intro.com
Dutch: http://nl.perl6intro.com
French: http://fr.perl6intro.com
German: http://de.perl6intro.com
Japanese: http://ja.perl6intro.com
Portuguese: http://pt.perl6intro.com
Spanish: http://es.perl6intro.com
The start page of https://docs.perl6.org/ is not referring there is a bug indeed. It will be fixed in a day or two.
1) The field is pretty crowded. There's a lot of languages competing for attention. It takes time to learn. Which ones should I spend time on?
2) Momentum. Scripty siblings Python & Ruby & JS & even PHP have active communities with a lot going for them.
3) Baggage. Some of the conventional wisdom about Perl 5 is pretty iffy, but it's well established conventional wisdom, dammit! In fact, you'll almost certainly see it recapitulated in this thread. Most arguments to the contrary seem to be slow to make a real dent in what Everybody Knows™ about Perl. The fact that Perl 6 is a different language will probably be equally slow. People will repeat the comforting mantra that Ruby is the new Perl. Order will be reinforced.
4) Blub-ish paradoxes. Perl 6 is doing some weird and different stuff. Is it hyper-useful weird and different stuff? Will I know until I learn to use it?
5) Not a big win in terms of market value yet.
IF you are going to find Perl installed on some system, it's more likely to be Perl 5 than anything newer.
You are very likely to find SOME version of Python, or Python compatible thing on most Linux distributions. Anything really old you're safe targeting Python 2.6 compat, maybe 2.7 compat. Anything relatively recent you will probably find a 'decent' version of Python 3.
And this is surprising?
(mentioned elsewhere, but let's distill it down)
On the other hand Perl 5 is faster for normal usage, and has mature library support, while perl6 has to catchup a lot. Perl 5 is only slower with their not-existing/silly object systems (Moose), there Perl 6 is much better.
Many perl5 devs just don't want to learn a new language yet.
Syntax: It explicitly deviates from perl6 and could have looked much cleaner.
See e.g. Inline::Perl5 and Inline::Python (don't know how mature that is).
>> For a new language to get adoption
I'm not really that knowledgeable right now, but how many weeks have Perl 6 (the language, not the libraries) had an implementation ready for production? :-)
Edit: Thanks, Ulti. Close to 50 weeks. Good work of the implementors. :-)
The python community have just about managed to achieve a backwards-incompatible change, which was fairly minor and developed in a reasonable timeframe to address certain specific issues.
The Perl community were made extravagant promises 15 years ago. People started holding their breath for 6. By now, everyone has given up and the delay has asphyxiated the community. Not to mention that the Perl niche is much more crowded and still has a working, complete Perl5 in it.
The "Learning Perl" book sucked hugely. CPAN is pretty cool but too many modules have poor documentation and almost no example code.
Web app frameworks got convoluted and didn't make things easier and tended to lock you into doing things their way.
Despite that, I still liked perl because it did let me do things my way. I waited and waited for Perl 6, and then quit caring.
This year I finally rewrote a perl/cgi web app in Javascript. What little server side I code I needed I used Perl 5 but there was very little.
Wow. It's always interesting to see how people can have such different takes on things. Perhaps it was the time in my programming career that I read it, but I remember being impressed with some of the programming practices it instilled. Never used Perl a whole lot, but the way Schwartz presented programming, not just Perl, I found very useful.
c.l.p.m. on the other hand, was a hatefest dominated by people who seemed to resent the peasants daring to touch "their" precious programming language.
I suppose we came in hordes and stormed their gates but all they really had to do was provide us with a space and that didn't happen.
Ironically, they did the same thing with the Raspberry Pi foundation reached out to them. No one responded.
I even went back to the "Perl Beginner's" mailing list and told them about the RPi Foundation and that Perl was being reviewed for the languages they would support with their Edu projects. No one responded.
At that point I don't think Larry Wall was involved much with Perl 5. And I know a few years before that he was frustrated with with lack of a cohesive path for Perl 6, and that not long ago he talked about how the Perl 6 Community had to reach out to educators and get involved with programs for kids.
The Python community did respond To the RPi Foundation when they reached out, and in a big way too. That's paid off big for them and the Foundation. Kids are growing up with Python now and will know it well and use it.
This evolution of languages has been interesting to observe.
Perl is the only language where devs see unreadability as a badge of coolness, indeed there was even an Obfuscated Perl Contest: https://en.wikipedia.org/wiki/Obfuscated_Perl_Contest
(There are golfing competitions in other languages, for example js1k, but the focus there is download size, the fact the code is obfuscated is a side effect rather than the point)
http://www.foo.be/docs/tpj/issues/vol5_1/tpj0501-0012.html
When I was still active on their mailing list there was a lot of excitement around Perl 6. By the time I left most others had already been long gone. They'd gotten smacked too many times.
None of that is Larry Wall's fault. He's been herding cats since he started these projects. I think Larry is great.
Perl Monks was super helpful to beginners and intermediate Perl programmers; unmatched then or now, I think; maybe the Go community is a modern parellel, as it has a very beginner-friendly culture, IME. IRC was always great (though I must concede it is somewhat cranky these day...not unhelpful, but not always as gentle about helping as it once was). I don't know which "Beginners Perl" mailing list you're referring to, but the ones I used to follow when I was learning (a couple of decades ago) were very helpful.
I'm sure there are cranky old Perlmongers in this world. And, it's been so long since I was paying close attention to beginner resources that I may have missed a shift in tone in that time. But, Perl, to me, was a great learning language.
And, I liked Learning Perl, though I think the Camel is a better book, and if you're not a true programming beginner, Programming Perl is the better book to read. Learning Perl teaches Perl and programming at the same time, and may not be the best way to learn either; though, again, I thought it was quite good, and was very empowering for me.
That's a great point. I've never thought of it like that but that is no doubt the reason why I strained with "Learning Perl".
Thanks for pointing that out!
We've taken something of a chainsaw to the 'RTFM dumbass' side of the community over the past half-decade or so - you can even discuss perl on irc.perl.org #perl these days.
That makes me want to join again!
I've been converting some old stuff to it to learn it, and it crazy how much more compact things can become. Working with grammars has been amazing. And I'm just now getting hit over the head with how flexible class roles with parameters can be to consolidate methods that do similar, but slightly different things.
I haven't even started into the concurrency bits yet... something about "promises" and "supplies". But I'm actually looking forward to it at this point. And that's really a surprising thing to me ;)
Anyway, my 2 cents on it at least. I'm not sure it matters if Perl is ever a poster child for anything. I think it kinda just doesn't matter.
Oh gosh that sounds scary. A lack of compactness was never Perl's problem, quite the opposite in fact.
> one should do token golf, not keystroke golf
> would be a nice cultural hack to start the Clean Golf meme
http://irclog.perlgeek.de/perl6/2014-03-11#i_8417918
Or like type. I've been loving their type system. You can use Perl as a heavily typed and enforced language, or not at all. And it's really easy to make up your own types, which you can also easily use for handling arbitrary constraints you might need.
Like there I just made up an new type called "Even", and used it when printing out stuff about numbers between 1 and 1000. But the really cool thing is you can use the exact sort of stuff for all kinds of variable types and even structures. It's just amazingly weird and open wonderful. I admit I've really fallen for it. ;)Basically at that point there were less Perl jobs and the language had (has?) bad reputation on being too easy to write hard to maintain code that I thought the language wasn't worth the peer pressure when Python or Ruby were nice languages too with open and welcoming communities behind them.
Perl 6 seems to add to that bad reputation unfortunately, adding extra complexity.
This is just an anecdote, but reading the comments seems like other people had a similar experience.
You are right that Perl 6 is more complex, but you will never see the majority of it until you decide you want to dig deeper.
If you write equivalent idiomatic code in both versions of Perl, the Perl 6 code will likely be less complex, shorter, more declarative, and easier to read.
The reason why existing Perl 5 developers don't migrate is because they don't need and/or want to. The benefit would mostly be derived from writing new code, but most Perl 5 code in the wild are legacy systems and complex admin shell scripts. Those are exactly the kind of thing that you don't want to rewrite in the latest-and-greatest; the potential to introduce subtle bugs by upgrading is more important than the benefit of being able to use new constructs in those parts that you need to improve. And the vast majority of new code is also admin shell scripts written by experienced greybeards, who really don't like their cheese moved, and so will stick to what they're used to for as long as they can.
Exactly. I continue to use Perl (5) for text munging, data cleaning, and gluing together programs written in other languages. It was designed for these tasks, I still need to do them, and nothing has come along since that is substantially better. When I need to do other things, I use other languages, and so far I haven't seen that Perl 6 has a "killer app."
i think the story it similar to Visual Basic 6 and VB .NET: the change between perl 5 and perl 6 is really big, perl 6 is a new language - not just a change of version, people who are comfortable with perl 5 have little incentive to learn it all again (or they have switched to python)