Live data from Hacker News

Larry Wall Unveils Perl 6.0.0

pigdog.org

131–140 of 336 posts

Re: Larry Wall Unveils Perl 6.0.0

#131
post #23

> ++; # An anonymous state variable, for very fast loops Perl, never stop being you

Also: react { whenever } # Code runs when a condition is met. I can only think this must be a generic https://en.wikipedia.org/wiki/COMEFROM . It is sure going to create some viciously subtle bugs.

That construct reminds me most of callbacks: you define some code, and register it to be called in certain circumstances.

Re: Larry Wall Unveils Perl 6.0.0

#132
post #84
post #74

Earlier quoted context omitted.

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 "be…

You can do this. I tried to draw up a quick gist, but I am late, and I've been writing too much Rust...

The basic idea is this:

  module Mst
    def self.included(base)
      # define a method on base using define_method named :before, which takes an
      # argument and a block
        # in that method, you grab the method with that name, using .method()
        # you then define a new method, named method, which calls the block and
        # then calls the original method
    end
  end

  class Foo
    include Mst

    def test
      puts "test"
    end

    before :test do
      puts "before"
    end
  end
Module named after you. You can see how the logic only changes a bit for after and around. You could then wrap this up as a library, and all you'd need to do is the include.

http://api.rubyonrails.org/classes/ActiveSupport/Callbacks/F... has an example, I think.

Re: Larry Wall Unveils Perl 6.0.0

#133
post #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_pin…

[deleted]

Re: Larry Wall Unveils Perl 6.0.0

#134
post #4

I honestly did not expect to see the day Perl 6 gets finished. This must have been one of the most difficult - if not the most difficult - births in the history of programming languages. At work, I have been using Perl 5 increasingly often over the past two years, mainly because handling unicode in Python 2 is not a lot of fun (and I still haven't come around to learning Python 3), and I have rediscovered why I used…

"At work, I have been using Perl 5 increasingly often over the past two years, mainly because handling unicode in Python 2 is not a lot of fun (and I still haven't come around to learning Python 3),"

Why?

Re: Larry Wall Unveils Perl 6.0.0

#135

Sounds like a v2.0 with feature bloat. ""Any infix operator can be replaced by itself in square brackets..." Later someone asked, "In a world of user-defined operators everywhere, how do you define precedence?" And Larry pulled out is tighter() and is looser(), noting that Perl 6 even has customizable precedence levels. "You can add an infinite number..."" It's been said that most of programming is about managing com…

A nice feature is that imports honor scope, so you can use a module and import functions or operators within a scope and not worry about it causing problems elsewhere.

Re: Larry Wall Unveils Perl 6.0.0

#136
post #4

I honestly did not expect to see the day Perl 6 gets finished. This must have been one of the most difficult - if not the most difficult - births in the history of programming languages. At work, I have been using Perl 5 increasingly often over the past two years, mainly because handling unicode in Python 2 is not a lot of fun (and I still haven't come around to learning Python 3), and I have rediscovered why I used…

"At work, I have been using Perl 5 increasingly often over the past two years, mainly because handling unicode in Python 2 is not a lot of fun (and I still haven't come around to learning Python 3)," Why?

From what he's saying, it's because of Perl 5's excellent Unicode support.

Re: Larry Wall Unveils Perl 6.0.0

#137
post #106

Earlier quoted context omitted.

Or until you trip over the API differences between str and bytes in Python 3 that do not exist in Python 2 (because str == bytes in Python 2). Chiefly, printf-style formatting... >>> b"%u" % 5 Traceback (most recent call last): File " ", line 1, in TypeError: unsupported operand type(s) for %: 'bytes' and 'int'

Fixed as of a month ago. https://www.python.org/dev/peps/pep-0461/

There's plenty of times it still matters. E.g. data coming in on webserver ->

json.loads(foo) blahblahException foo is bytes not text.

That said I still endorse py3 for new things

Re: Larry Wall Unveils Perl 6.0.0

#139

Seems too little too late. Is Perl still relevant in 2015? What would you build in Perl today that you wouldn't build in another language instead? I used to be a big fan of Perl but it seems to have fallen behind the times, I doubt Perl 6 is enough to catch up.

There are quite a few Perl shops in LA writing new code and more than a few maintaining apps that have been around for a while. Lacking the sex appeal of Node and Go (or whatever the next hotness will be) doesn't mean something isn't relevant. Why build something in Perl? The same reasons you'd write something in Python, Ruby, C#, Java, etc: - Mature tooling - Excellent library support - Code samples written for rele…

    > There are quite a few Perl shops in LA writing new code
These include Broadbean (in Irvine) and ZipRecruiter in central LA.

Re: Larry Wall Unveils Perl 6.0.0

#140
post #84

Earlier quoted context omitted.

> 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 "be…

You can do this. I tried to draw up a quick gist, but I am late, and I've been writing too much Rust... The basic idea is this: module Mst def self.included(base) # define a method on base using define_method named :before, which takes an # argument and a block # in that method, you grab the method with that name, using .method() # you then define a new method, named method, which calls the block and # then calls the…

That's really cute.

I hope, however, that you can understand from the POV of somebody who keeps being driven off ruby by ruby being too much work, that "you could make it less work by first porting all the perl5 libraries that make perl5 OO more pleasant" isn't really a convincing solution :)

Post reply on HN