News for hackers. Stuff that matters.
Re:Data munging in Perl 6 vs. Perl 5 by jrochkind1 on Tuesday December 09, 2014 @06:41PM (#8726626)
Question which is meant to be an honest question and not a troll, I really want to know and accept that some might have reasonable answers:

Why would you use Perl6 instead of ruby?

Re:Data munging in Perl 6 vs. Perl 5 by muraiki on Tuesday December 09, 2014 @11:19PM (#8727673)
I think Perl 6's killer feature is actually concurrency. P6 provides a number of ways to do reactive programming, channels, actor model semantics, etc. It even offers some new ways to approach modeling concurrency and asynchronous logic.

Here's a quick intro to supplies: http://perl6advent.wordpress.com/2013/12/19/perl-6-supplies-...

Here's a more in depth exploration of Perl 6's concurrency features: http://jnthn.net/papers/2014-nlpw-reactive.pdf

If you want to use a dynamic language (albeit also offering optional static typing) with powerful concurrency options that doesn't also involve s-expressions, I think P6 might be one of the few options available. I'm not familiar with Ruby, but from what I've heard the default runtime has some limitations when it comes to concurrency, and while it's been a while since I used Python, I recall hearing that it also has some problems with handling concurrency.

Re:Data munging in Perl 6 vs. Perl 5 by zaphar on Tuesday December 09, 2014 @08:27PM (#8727129)
I don't currently use either but Perl6 grammars[0] are pretty dang awesome. If I were writing parsing code and my choices were Ruby or Perl6 I would choose Perl6 just for the grammars.

[0] http://doc.perl6.org/language/grammars

Re:Data munging in Perl 6 vs. Perl 5 by kamaal on Wednesday December 10, 2014 @12:25AM (#8727822)
A full answer will look like a book.

The short answer, is that the comparison isn't fair to either communities. Perl 6 has many killer features. Concurrency, Macros, Grammars, Regex goodness, functional programming features, OO features, Strong typing support, user defined operators, multiple VM backends, Continuations to name a few. But there are many many others.

Perhaps the most killer feature of Perl 6 is like lisp, you can use the language to grow itself without breaking backwards compatibility. This alone will ensure that the community can grow without worrying about breakage, regression and backwards compatibility.

Read more here: http://perlcabal.org/syn/

Ruby and Perl 5 definitely have more libraries, users and a far more mature ecosystem of things. But I guess the sheer awesomeness of Perl 6 will attract a lot of developers and that will have a healthy community of its own.

In short I think there are plenty of reason why one would chose Perl 6 above Ruby.

Re:Data munging in Perl 6 vs. Perl 5 by esaym on Wednesday December 10, 2014 @12:14AM (#8727797)
I thought of a few troll-worthy comments, but then moved on to others. Few things came to me though later that are less abrasive so I guess I'll share these nicer sides of my opinion:

I don't know if it will be the same for perl6, but at least with perl5, backwards compatibility was rarely broken. Every time my debian-testing box upgraded a ruby version, it broke something. From 1.8,1.9,2.0, and I think 2.1 actually worked without any issues...

This is never an issue with perl5. And before you say "perl is dead it never changes", go look on the perl5porters mailing list. There are a ton of changes going on. I had every intent this year to join the dev team, but the commits come in so quick on that mailing list, I can never find a place to start. When perl5 updates to a new version (which has been happening once a year for like 5 years now), it is not just a few bugs that are fixed, but a whole lot of new features are added and plenty of new syntax to scare the heck out of anyone. So an argument of the ruby dev cycle is 'slower' probably won't hold up.

Onto more perl6 specifics, I think one of the original goals was perl6 being able to compile a script into a raw binary. Don't know if that feature will be implemented. Ruby can't do that, though it does have the JIT compile stuff. So I guess that could be one reason..

Perl6 is new, so I guess it is full of new "technology and stuff" right?

I personally never did much with ruby. I tried to use it as my first language to learn with. I signed up on some hacker forum wanting to learn to hack with my new found ruby skills... They just booted me with the message of "ruby aint really programming". This was back in 2007, but I never could get over that...

From then on I only used Ruby when I couldn't figure out how to do something in perl. So none of my ruby scripts have ever been seen by another pair of eyes. I keep them all hidden, knowing that they are cool and all in their own right, but knowing if I were just a little smarter... I could have written it in perl...

Re:Data munging in Perl 6 vs. Perl 5 by debacle on Tuesday December 09, 2014 @11:44PM (#8727725)
Speed. Always speed. Perl is still faster than every other scripting language out there.
Re:Data munging in Perl 6 vs. Perl 5 by Ultimatt on Wednesday December 10, 2014 @05:39AM (#8728580)
Not true for Perl6 at the moment. Perl6 is an entirely different language with its own implementation. At the moment it will be either on par or slower than Ruby. For some select numerical operations Perl6 is faster than Perl5. But for the rest it's between 100x and 10x slower than Perl5. This is what is being worked on now up to the official release of 6.0.0 though.
Re:Data munging in Perl 6 vs. Perl 5 by cygx on Wednesday December 10, 2014 @04:06AM (#8728339)
Perl is still faster than every other scripting language out there.

Wait, what? There are are specific use cases where this might still be true, but as a general rule, this hasn't been the case for some years now.

Re:Data munging in Perl 6 vs. Perl 5 by zzzcpan on Tuesday December 09, 2014 @07:42PM (#8726902)
It depends. Why would you use Ruby instead of Perl 5?
Re:Data munging in Perl 6 vs. Perl 5 by jrochkind1 on Tuesday December 09, 2014 @08:41PM (#8727185)
Ruby instead of Perl5 (not Perl6)? Because I found Perl5 really hard to write maintainable comprehensible code in, requiring weird magic boilerplate, and full of gotchas. Could just be me, maybe could have been overcome, was just my subjective opinion. And I like writing OO code in Ruby style. Also, like many others, what brought me to ruby was wanting to check out Rails (although now I'd say I have fonder feelings for ruby the language than I do for Rails the framework). All just my own opinions and experiences.

Those sorts of answers from other's perspectives is what i'm interested in for Perl6 (not 5) over ruby. I think I know many reasons to prefer perl5 over ruby (although I don't), but once you leave perl5 for perl6... I'm not sure why you wouldn't just ruby (or python). But could be just cause you're used to Perl and like Perl. Or could be because there's something about Perl6 you especially like over ruby/python. Etc. I think it's a reasonable question?

Re:Data munging in Perl 6 vs. Perl 5 by Ultimatt on Wednesday December 10, 2014 @05:57AM (#8728623)
You wont get many opinions of people's experience of Perl6 from Hacker News. Just a lot of rage and assumptions it's somehow just like Perl5, which it's not. There are only a few of us (tens, maybe a hundred very quiet people) actually writing it daily. With no official "released" 6.0.0 version it's not supported that well by Linux distros yet either. Like if you install Rakudo on Debian stable right now it would be about two years out of date iirc. In the last two years a custom Perl6 VM was written with a JIT compiler and tonnes of concurrency stuff was added! You can however easily install it yourself and keep up to date with rakudobrew http://perl6advent.wordpress.com/2014/12/02/day-2-rakudobrew...

My $0.02 is you'd mostly want to learn Perl6 if you were after something like Ruby but perhaps with more room to express yourself and form a community and build new technologies. At least I really love the language and find it very expressive and intuitive to use and it has a lot of features useful for doing Bioinformatics built in (something I'm going to add to the P6 advent calendar on the 15th Dec). The extra level of detail ten years of design puts into a language like all the funky features working together and being consistent helps a lot. So much of the cooler expressive/functional stuff in Python feels out of place like lambda and list comprehensions. Maybe I'm wrong but I wouldn't write anything /that/ complicated or important using Python lambda or list comprehensions. They just don't play that well with the surrounding code you will have to write in a different style. I can't attest to Ruby since I don't know it well. I felt it was quite close to Perl and I'd be better placed learning Python instead, especially for a job writing code that wasn't for the web.

Re:Data munging in Perl 6 vs. Perl 5 by zzzcpan on Wednesday December 10, 2014 @10:31AM (#8729638)
Perl 6 tries to address many of the Perl 5's gotchas, including OO. Throw in familiarity into that and a lot of new features that scratch various itches and you would understand why some Perl 5 people would want to try Perl 6, but not Ruby.

Maintainability, productivity, etc. of Perl 5 is on the same level with Ruby. And I don't think Perl 6 improves on that, so it's probably the same too.

Personally I don't see any benefit for anyone to switch between mentioned languages. They all have similar problems.