Naive question time. Is Perl 6 something that non-Perl developers should be looking into?
This may be inflammatory, but it's my earnest impression : as an outsider, I really don't like how Perl's versioning was handled (5 vs. 6). On top of being unnecessarily confusing, it also gives an impression of complete mismanagement - fair or not.
With so many languages out there to choose from, what sets Perl 6 apart from other modern languages and ecosystems?
Although I program in Perl 5 professionally, I think that Perl 6 is something that non-Perl developers should look into. While it's true that P6 draws inspiration from a variety of languages and techniques, from Smalltalk through Reactive Extensions and more, a laundry list of features is not necessarily the best reason to adopt a language -- especially one with a small ecosystem.
Instead, I think that P6 is worth looking at because of the "feel" of the language, or perhaps another way to put it is the way that all the pieces fit together. I found it easy to do the following in Perl 6:
1. Quickly write a small proof of concept program
2. Heavily use concurrent and asynchronous code in a way that "just works"
3. Fluidly mix imperative, functional reactive, and object oriented code
4. Add types for safe refactoring / further development
Even though Perl 6 still abides by TIMTOWTDI (There Is More Than One Way To Do It) there was "something" that gave a consistency to all of the above. Or perhaps, nothing felt bolted on, which is perhaps a luxury of essentially starting from scratch. :)
Perl 6 is not only fun to write, but also easy to read (once you of course learn the syntax, which is quite different coming from not-perl). My hope is that the ease of using its OO features and type system will help avoid the "hash-of-who-knows-what" problem.
Lately the two languages I most enjoy using are Perl 6 and Go, which would appear to be almost total opposites! But they both have that "something" that just feels great to write. This is of course subjective, but I hope it's helpful somehow.
> Is Perl 6 something that non-Perl developers should be looking into?
Perl5 was feeling the weight of its humble origins as a small language for scripts, designed in the 80's. All that $@%<>$_ syntax, and bad support for keeping larger programs clean and organized.
Python's main selling point was: like Perl, but cleaner syntax and object system is in-build, not bolted on as an afterthought.
Also Ruby's selling point was: Perl, flexible for meta-language hacking like Perl, but cleaner syntax and in-build object system, also not as restrictive as Python.
Now Perl6 has everything that at a time made Python or Ruby feel more modern than Perl5, and more, even optional typing. (Well, it doesn't have Python's opinionated restrictiveness.) Of course at the moment, Perl6 doesn't have the huge selection of libraries that Python and Ruby have at the moment.
I don't know what, if anything, is a good reason for you to learn a new language. But while in the trio perl5,python,ruby perl5 was the most dated, old-feeling language, now in the trio perl6,python,ruby Perl6 is now the most modern in its design.
The goal of Perl 6 is to pull together many different things. The clarity of the original Perl, the ease-of-use of Java, the community size of experimental languages like Self, the raw performance of Bash scripting, and the safety of C++. If that's a combination that appeals to you, then go for it.
I think it's less what Perl 6 has that other languages don't have (almost everything is implemented in at least one language), and more that it implements everything together in one language. The pure breadth of what is supported is somewhat staggering. I posted the other day[1] about what I thought were some interesting features, so that might be a good start for some things that might set it apart.
Don't know much about the rest of the language, but the Perl 6 regexes are a big improvement and I hope they take over as the conventional syntax in the world outside of Perl.
There are plenty of Perl5 users that have never liked the idea of "Perl6" and swear that they will never use it. That is just one of the reasons why Perl6 took awhile to release. It was not made by the Perl5 community, it was/is a different community although it does have some Perl5 guys strewn through it. It will be interesting to see how it turns out. I plan on picking it up soon. So yes, non-perl people should try it. Other than the name, and Larry Wall, there is not much the same between the two.
I am not following your issues with the versioning. Perl6 was supposed to be released like back in 2005 or so. In that context it made sense that the next release of Perl would be 6 and that the 5 series would just go into maintenance only mode. But that didn't really happen. Perl5 devs continued to do their own thing while a new community was built around Perl6 with different people.
Exploiting a post with this question, as somebody who knows Perl 5, I'd like to ask people that knows Perl 6:
Will I be able to write a dictionary of dictionaries or arrays without looking at the documentation every time? Did Perl 6 syntax for references got sane?
Regarding versioning, it seems Perl did the same trick as Mac OS, minus the marketing part. From Mac OS 9 to Mac OS X, there was a total rewrite (which was originally planned for OS 8 but got delayed until NeXT saved the day). Switching from 10 to X (besides the unix/NeXT allusion) was a great way to remove focus on the major release number and shift it to the minor one.
So look at it as Perl VI, minor version 0. :)
Perl6's main strength and which makes it "fun" is that it is multi-paradigm. It supports many ways of approaching a problem, instead of forcing a particular model. So you get a toolbox instead of just a modular hammer.
Multiple dispatch in a scripting language is enough to make me take a serious look at Perl.
The versioning was weird, but it could have been worse. At least they didn't take the PHP option and leap from v5 to v7 because the number 6 was cursed.
> Naive question time. Is Perl 6 something that non-Perl developers should be looking into?
As a non-Perl dev who has been looking into Perl 6 after encountering some posts and samples, I'd say it is, though unfortunately the kind of documentation that would make the most interesting bits easily approachable is still somewhat lacking.
Given that perl 6 is compatibility breaking, we can category say that if it is not something non-Perl developers should be looking into, it has utterly failed: it means you've made a completely new language nobody should use who isn't already using it!
that said, I don't think it's failing by this metric.
What exactly don't you like about the way they did the versioning?
Do you prefer what python did? Python 2 vs. Python 3 is a complete and utter mess. Perl, which exists mostly in the same use case, shouldn't have any of those problems.
A lot of sysadmin stuff is really well supported in Perl. However, I do a lot of sysadmin work and I've never learned Perl. I use shell scripts, awk, sed, et. al, and when necessary to go beyond that I'll reach for Python (or lately, Ansible) because I find it so much more readable.
I always felt that programming in perl was fun. Fun don't pay the bills though so over time I programmed less in perl. I suspect that with the perl 6 release a lot of people are starting to go back to it and having fun with it again. And like the author mentions, they improved on a lot of things with perl 6.
One question I haven't seen asked in this particular thread is, can it be used in production? What type of ecosystem is available (something like CPAN) for Perl 6 and how reliable is it? Two questions I suppose, but I guess the first one is more important.
Edit:
What I really mean by "can it be used in production" is really: is anyone using it in production and what is their experience with it and their recommendations?
I know someone who is a Software Reliability Engineer at Google (sysadmin on steroids is my interpretation of the position) that's written a few back-end tools in it, and I think those were likely shared with his department. So there's that.
I loved Perl 5. Now when Perl 6 is out, I'm a bit confused about versioning. As far as I understand, perl 6 files are of .pl6 extension. Why would that be different from regular .pl, giving that it's just a new version of a language? I mean, I have never seen things like .js5, .php6, etc. Next, is `use v6;` mandatory? Quite confusing. Am I allowed to do `use v2;`?
Your confusion lies in thinking, as you've said, "just a new version of a language." It's actually been a long, 15-year journey that resulted in a completely brand new language. The name is still 'Perl 6' for historical reasons, but it may as well be called 'Rakudo'; something people've not heard of yet. The Perl 5 language is still being developed and improved, with a major release every year. Hence, the filename distinction.
However, it's just a convention. You can have any extension you like (at least on *nix).
And to answer your question, no "use v6" is not mandatory. It's there so if you run your script with a perl (and not perl6) interpreter, you won't get confusing errors.
The extension is not mandatory. Usually people use .p6, but you can also use .pl . Notice that I've never seen .pl6.
'use v6;' is not mandatory either, but it allows your program to display an helpful error message if you try to run it with the perl 5 interpreter. Try "perl -e 'use v6;'", you should get:
Perl v6.0.0 required--this is only v5.20.2, stopped at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
'use v2;' will not run with the Perl 6 interpreter, but 'use v5;' will work, as the Perl 6 interpreter is specced to be able to run Perl 5, albeit with certain limitations (no XS, for instance).
`use v6;` actually means "use the latest version of Perl 6". I believe you can even do `use v6.b` and other versions to target specific releases of Perl 6, though I'm not sure if that's implemented yet.
Some text editors also will change to a Perl 6 highlighter if this pragma is present.
Rakudo isn't JVM "based", but the JVM is one VM that it targets (also MoarVM, and Parrot. I imagine at some point the .Net CLR will be added). That said, take a look at this[1].
Insofar as there is a "Rakudo VM", its MoarVM, which is not JVM-based; Rakudo also compiles for the JVM, and there's some documentation on interop floating around, but most of it seems to be both old and indicating that the JVM interop was in flux at the time.
The situation is really quite different. Perl 6 is a sister language, Perl 5 is still quite actively being developed, and the wait has certainly made many hesitant to begin upgrading. One thing to keep in mind is that Python 2 is just now finally starting to wane, so I am guessing that if Perl 5 does end up going the way of Python 2, it won't be for quite some time.
[+] [-] doktrin|10 years ago|reply
This may be inflammatory, but it's my earnest impression : as an outsider, I really don't like how Perl's versioning was handled (5 vs. 6). On top of being unnecessarily confusing, it also gives an impression of complete mismanagement - fair or not.
With so many languages out there to choose from, what sets Perl 6 apart from other modern languages and ecosystems?
[+] [-] muraiki|10 years ago|reply
Instead, I think that P6 is worth looking at because of the "feel" of the language, or perhaps another way to put it is the way that all the pieces fit together. I found it easy to do the following in Perl 6:
1. Quickly write a small proof of concept program
2. Heavily use concurrent and asynchronous code in a way that "just works"
3. Fluidly mix imperative, functional reactive, and object oriented code
4. Add types for safe refactoring / further development
Even though Perl 6 still abides by TIMTOWTDI (There Is More Than One Way To Do It) there was "something" that gave a consistency to all of the above. Or perhaps, nothing felt bolted on, which is perhaps a luxury of essentially starting from scratch. :)
Perl 6 is not only fun to write, but also easy to read (once you of course learn the syntax, which is quite different coming from not-perl). My hope is that the ease of using its OO features and type system will help avoid the "hash-of-who-knows-what" problem.
Lately the two languages I most enjoy using are Perl 6 and Go, which would appear to be almost total opposites! But they both have that "something" that just feels great to write. This is of course subjective, but I hope it's helpful somehow.
[+] [-] sampo|10 years ago|reply
Perl5 was feeling the weight of its humble origins as a small language for scripts, designed in the 80's. All that $@%<>$_ syntax, and bad support for keeping larger programs clean and organized.
Python's main selling point was: like Perl, but cleaner syntax and object system is in-build, not bolted on as an afterthought.
Also Ruby's selling point was: Perl, flexible for meta-language hacking like Perl, but cleaner syntax and in-build object system, also not as restrictive as Python.
Now Perl6 has everything that at a time made Python or Ruby feel more modern than Perl5, and more, even optional typing. (Well, it doesn't have Python's opinionated restrictiveness.) Of course at the moment, Perl6 doesn't have the huge selection of libraries that Python and Ruby have at the moment.
I don't know what, if anything, is a good reason for you to learn a new language. But while in the trio perl5,python,ruby perl5 was the most dated, old-feeling language, now in the trio perl6,python,ruby Perl6 is now the most modern in its design.
[+] [-] s_kilk|10 years ago|reply
I had zero perl experience before diving into perl6. I've found it to be a great language with a fun community.
As for compelling features, there was a good discussion on this a few days ago, so I'm just going to link to that: https://news.ycombinator.com/item?id=10637789
[+] [-] reality_czech|10 years ago|reply
[+] [-] jeffdavis|10 years ago|reply
Program something in it, and if you get a good feeling, then probably a lot of other people will too, and the language will take off.
Larry Wall is a linguist, and I think that is probably what sets perl apart more than anything.
But yes, it happens to have the kitchen sink, too.
[1] Unless you have hard requirements, like control over memory or runtime environment.
[+] [-] kbenson|10 years ago|reply
1: https://news.ycombinator.com/item?id=10642153
[+] [-] bcoates|10 years ago|reply
[+] [-] esaym|10 years ago|reply
I am not following your issues with the versioning. Perl6 was supposed to be released like back in 2005 or so. In that context it made sense that the next release of Perl would be 6 and that the 5 series would just go into maintenance only mode. But that didn't really happen. Perl5 devs continued to do their own thing while a new community was built around Perl6 with different people.
[+] [-] marcosdumay|10 years ago|reply
Will I be able to write a dictionary of dictionaries or arrays without looking at the documentation every time? Did Perl 6 syntax for references got sane?
[+] [-] athenot|10 years ago|reply
So look at it as Perl VI, minor version 0. :)
Perl6's main strength and which makes it "fun" is that it is multi-paradigm. It supports many ways of approaching a problem, instead of forcing a particular model. So you get a toolbox instead of just a modular hammer.
[+] [-] giaour|10 years ago|reply
The versioning was weird, but it could have been worse. At least they didn't take the PHP option and leap from v5 to v7 because the number 6 was cursed.
[+] [-] dragonwriter|10 years ago|reply
As a non-Perl dev who has been looking into Perl 6 after encountering some posts and samples, I'd say it is, though unfortunately the kind of documentation that would make the most interesting bits easily approachable is still somewhat lacking.
[+] [-] agumonkey|10 years ago|reply
[+] [-] logicallee|10 years ago|reply
that said, I don't think it's failing by this metric.
[+] [-] vshjxyz|10 years ago|reply
I personally avoid it like a disease... Python + Ruby + JS are wayyy more used and future proof
[+] [-] nickysielicki|10 years ago|reply
Do you prefer what python did? Python 2 vs. Python 3 is a complete and utter mess. Perl, which exists mostly in the same use case, shouldn't have any of those problems.
[+] [-] latj|10 years ago|reply
[+] [-] ams6110|10 years ago|reply
I have no plans to look at Perl 6.
[+] [-] autarch|10 years ago|reply
[+] [-] xlm1717|10 years ago|reply
[+] [-] latenightcoding|10 years ago|reply
Not true at all. Thanks to perl I have been working high paying jobs from home since I was 19.
And I always get banks or other big companies contacting me because they need a UNIX/Perl programmer or a sysadmin
[+] [-] nickysielicki|10 years ago|reply
I think a lot of sysadmins have made their living by writing perl for the majority of their career.
Certainly there are more people writing perl today than lisp, golang, rust, or haskell.
[+] [-] autarch|10 years ago|reply
[+] [-] landr0id|10 years ago|reply
[+] [-] giancarlostoro|10 years ago|reply
Edit:
What I really mean by "can it be used in production" is really: is anyone using it in production and what is their experience with it and their recommendations?
[+] [-] kbenson|10 years ago|reply
[+] [-] justinator|10 years ago|reply
For now, it's fun to see what the future will bring. I'm excited.
[+] [-] atrust|10 years ago|reply
[+] [-] zoffix222|10 years ago|reply
However, it's just a convention. You can have any extension you like (at least on *nix).
And to answer your question, no "use v6" is not mandatory. It's there so if you run your script with a perl (and not perl6) interpreter, you won't get confusing errors.
[+] [-] grondilu|10 years ago|reply
'use v6;' is not mandatory either, but it allows your program to display an helpful error message if you try to run it with the perl 5 interpreter. Try "perl -e 'use v6;'", you should get:
'use v2;' will not run with the Perl 6 interpreter, but 'use v5;' will work, as the Perl 6 interpreter is specced to be able to run Perl 5, albeit with certain limitations (no XS, for instance).[+] [-] MadcapJake|10 years ago|reply
Some text editors also will change to a Perl 6 highlighter if this pragma is present.
[+] [-] cygx|10 years ago|reply
Some Fortran people do it.
[+] [-] _pmf_|10 years ago|reply
Given that Rakudo VM is JVM based, I expected that there's some interoperability layer for the host JVM, but could not find anything.
Does someone know whether this is possible?
[+] [-] kbenson|10 years ago|reply
1: https://perl6advent.wordpress.com/2013/12/03/day-03-rakudo-p...
[+] [-] dragonwriter|10 years ago|reply
Insofar as there is a "Rakudo VM", its MoarVM, which is not JVM-based; Rakudo also compiles for the JVM, and there's some documentation on interop floating around, but most of it seems to be both old and indicating that the JVM interop was in flux at the time.
[+] [-] cygx|10 years ago|reply
The JVM is just one of the backends, but it's fallen a bit by the wayside during the current effort to get 6.0 out on MoarVM.
I expected that there's some interoperability layer for the host JVM
There is, but I'm unaware of proper documentation. For now, you might want to take a look at https://github.com/rakudo/rakudo/blob/nom/t/03-jvm/01-intero...
[+] [-] wodenokoto|10 years ago|reply
[+] [-] MadcapJake|10 years ago|reply
[+] [-] unixhero|10 years ago|reply
PERL is a shuffling of REPL
[+] [-] justinator|10 years ago|reply
http://perldoc.perl.org/perlfaq1.html#What%27s-the-differenc...
Welcome to the Perl subculture!
[+] [-] pearjuice|10 years ago|reply
>fun
Pick one and choose wisely.