Live data from Hacker News

Larry Wall Unveils Perl 6.0.0

pigdog.org

81–90 of 336 posts

Re: Larry Wall Unveils Perl 6.0.0

#81
post #24

Earlier quoted context omitted.

Here's something that's normally not too fun to deal with in Python and Ruby: asynchronous operations. Perl 6 has promises, C#-style async/await, Go-style channels, and Reactive Extensions-style Supplies built in as first-class ways to deal with asynchrony, concurrency, and parallelism. It can also take advantage of as many threads as you'll give it. Since I deal with web services a lot, this is a huge boon for me. B…

Are you talking about Clojure ;)

I actually like Clojure quite a bit and used Racket (with How to Design Programs) when I first began my foray into becoming a programmer. Here are a few reasons why I'm more excited about Perl 6 now than I am about Clojure (although I still think Clojure is great):

1) Async. While I was initially enamored of core.async, I've found promise combinators and supplies to be a more useful and higher level abstraction for the type of work I do. I also had huge problems debugging generated core.async code, but maybe that's changed over time. I suppose I could use RxJava with Clojure for supplies, but I have a feeling that it's not really seen as being in the same style. This is also why I'm not as big of a fan of Go as I once was, too.

2) As peatmoss mentioned, startup time. I work at a web hosting company and as you can imagine we write lots of small scripts. Clojure really can't compete in this area.

3) Gradual typing. Perl 6 supports gradual typing, with functions being checked at compile time and methods being checked at run time (the latter was a decision to allow both a powerful metaobject protocol and also easy interop with other languages using things like Inline::Python). I know that Clojure has core.typed, but that's not really what I'm looking for, although I do think it's an excellent project.

A final quality of life difference: Perl 6 has invested a lot of effort into awesome error messages, including things like suggesting a close lexical variable if you mistyped one. While every Clojurist learns to deal with the stack trace o' doom, there's something good to be said about this. :)

Re: Larry Wall Unveils Perl 6.0.0

#82

> One of the most impressive things Larry demonstrated was the sequence operator, and Perl 6's ability to intuit sequences. say 1, 2, 4 ... 2**32 > This correctly produced a nice tidy list of just 32 values -- rather than the 4,294,967,296 you might expect. Someone with more time than me needs to find an IQ test that is based around sequence questions like this and plug them all into Perl 6. So we can find out what P…

Try putting two spaces at the beginning of a line to stop HN from eating the asterisks.

  > say 1, 2, 4, 2**32

Re: Larry Wall Unveils Perl 6.0.0

#83

Earlier quoted context omitted.

As a fan / dilettante of Clojure, I'd say no. The JVM is many nice things, some nasty things, but definitely not lightweight in terms of things like startup speed that I'd expect of Perl 6.

"The JVM is many nice things, some nasty things, but definitely not lightweight in terms of things like startup speed" The jvm startup speed is actually surprisingly good these days. We were experimenting with writing several commandline tools with Scala, and didn't think they would work because of this "well-known" issue. Turns out it was fast enough even to enable letting Scala handle things like the code completio…

I'd agree that the JVM itself isn't so bad in terms of startup time. However, the last time I compared Clojure and Scala, Clojure took significantly longer to start up (even though what I was doing in Clojure was nothing compared to all the libraries I was pulling in with Scala!)

Edit: I should add that there's a Perl 6 JVM backend. While it's not as up-to-date as the default MoarVM, it could also be ready "for Christmas" :)

Re: Larry Wall Unveils Perl 6.0.0

#84
post #74
post #18

Earlier quoted context omitted.

Every time I try and write ruby I end up giving up because the OO is boilerplate heavy and restrictive compared to Moo/Moose. Basically "No method modifiers and I have to write my own constructors? Really?" always drives me away within a few hours.

Method modification is trivially done through "alias" and then just redefining the method in Ruby, if you re-open the same class. If you subclass, then "super" is sufficient. I'm curious what you actually mean here. As for writing your own constructors, you only need to do so if you actually need to initialize something, and since instance variables can be used without having initialized them in a constructor (they'l…

> Method modification is trivially done through "alias" and then just redefining the method in Ruby

I don't know how to convert this into ruby then without needing to manually gensym a bunch of names:

    use Class::Method::Modifiers;
    
    sub foo { 2 }
    
    before foo => sub { warn "before foo 1" };
    
    around foo => sub {
        my ($orig, $self) = (shift, shift);
        warn "around foo";
        (1, $orig->$self(@_), 3);
    };
    
    before foo => sub { warn "before foo 2" };
> As for writing your own constructors, you only need to do so if you actually need to initialize something

Which is required if you're going to use value objects as much as possible rather than spraying mutable state everywhere.

Re: Larry Wall Unveils Perl 6.0.0

#85
post #82

> One of the most impressive things Larry demonstrated was the sequence operator, and Perl 6's ability to intuit sequences. say 1, 2, 4 ... 2**32 > This correctly produced a nice tidy list of just 32 values -- rather than the 4,294,967,296 you might expect. Someone with more time than me needs to find an IQ test that is based around sequence questions like this and plug them all into Perl 6. So we can find out what P…

Try putting two spaces at the beginning of a line to stop HN from eating the asterisks. > say 1, 2, 4, 2**32

Thank you. I spent far too long trying to figure out what sequence would start "1, 2, 4" and then have 232 be the 32nd item.

Re: Larry Wall Unveils Perl 6.0.0

#86
I've found these resources helpful for learning Perl 6:

http://learnxinyminutes.com/docs/perl6/ is a pretty good intro to Perl 6 if you just want to jump into things.

http://www.jnthn.net/papers/2015-spw-perl6-course.pdf is more slowly paced but provides greater detail.

Also, the people in #perl6 on Freenode are all awesome and are usually quick to help beginners unless they are in the middle of fixing some crazy bug.

Re: Larry Wall Unveils Perl 6.0.0

#87
post #82

Earlier quoted context omitted.

Try putting two spaces at the beginning of a line to stop HN from eating the asterisks. > say 1, 2, 4, 2**32

Thank you. I spent far too long trying to figure out what sequence would start "1, 2, 4" and then have 232 be the 32nd item.

Oops, sorry! Fixed it.

Re: Larry Wall Unveils Perl 6.0.0

#88
post #79
post #62

Earlier quoted context omitted.

> I still haven't come around to learning Python 3 I'm not using it everyday yet either, but it's not a whole new language. More like just a few cleanups to sensitive portions of the API.

I would love to see a concise document with the differences.

https://docs.python.org/3/whatsnew/3.0.html

Re: Larry Wall Unveils Perl 6.0.0

#89
I'm really surprised this site is the source y'all chose to upvote. Not only was the second-newest article published in 2012, they also have an assortment of other questionable content[0][1]. Advertising from rotten.com and a category named "Jonny Jihad" are also professional touches.

I mean, whatever floats your boat, but HN, is this really one of your go-to trusted news sources?

[0] http://www.pigdog.org/in_the_pink/html/interview_with_a_stri... [1] http://www.pigdog.org/pooniedog/

Re: Larry Wall Unveils Perl 6.0.0

#90
post #74
post #18

Earlier quoted context omitted.

Every time I try and write ruby I end up giving up because the OO is boilerplate heavy and restrictive compared to Moo/Moose. Basically "No method modifiers and I have to write my own constructors? Really?" always drives me away within a few hours.

Method modification is trivially done through "alias" and then just redefining the method in Ruby, if you re-open the same class. If you subclass, then "super" is sufficient. I'm curious what you actually mean here. As for writing your own constructors, you only need to do so if you actually need to initialize something, and since instance variables can be used without having initialized them in a constructor (they'l…

[deleted]
Post reply on HN