Hacker News new | ask | show | jobs
by smallsharptools 4163 days ago
Perl was the language that I used many years ago but I moved on. Perl 6 was announced in 2000 and took over 10 years to see a release and by then most developers moved on like I did. When a language takes that long between releases there's clearly a lack of enthusiasm and support for the language. And touting market share? That is a pointless argument. You should be working with multiple languages and move past these silly blog posts.
2 comments

Perl 6 is not an upgrade of Perl 5. It is a whole different language.

Perl 5 is thriving too. It has many improvements to the Perl 5 of 10 years ago.

Perl 6 was supposed to be an upgrade but it kept changing. I lost interest and know I will never use it. And if it is a totally different language why is it called Perl?
> why is it called Perl?

The same guy (Larry Wall) who originally wrote Perl 1 to 5.6 is the one who is writing the spec (though not the implementations) for Perl 6. People let him do it out of respect, even though it's disastrous for Perl 5.

I've seen quite a few people describe Python 3 as a new language relative to Python 2. Having used both now, I don't agree at all, but I have no experience whatsoever with Perl so I'm not in the same position to compare the different versions of it.

Are there really more differences than things they share in common, to the extent that "new language" is an accurate description?

I think it is correct to view them as related, but definitely not the same language.

A short example from the recent Perl6 calendar[1]:

Perl5:

    package Timer;
    
    use Time::HiRes qw(gettimeofday tv_interval);
    use Mojo::Base -base;
    use experimental 'signatures', 'postderef';
    
    has _event_log  => sub { [] };
    has _start_time => sub { [ gettimeofday ] };
    
    sub record ($self, $event_description) {
        # record the event and timestamp
        my $event = {
            timestamp   => sprintf('%.3f', tv_interval($self->_start_time)),
            description => $event_description,
        };
        push($self->_event_log->@*, $event);
    }
    
    sub report ($self) {
        # render a full report
        my $report = '';
        foreach my $event ($self->_event_log->@*) {
            $report .= sprintf "[%s] %s\n", $event->{timestamp}, $event->{description};
        }
        return $report;
    }
    1;
Perl6:

    class Timer {
        has $!start-time;
        has @!event-log;
    
        method record ($event_description) {
            # initialise the start-time if this is the first time through
            $!start-time //= now;
            @!event-log.push({
                timestamp   => now - $!start-time,
                description => $event_description
            });
        }
        method report {
            my @report_lines;
            for @!event-log -> %event {
                 @report_lines.push("[%event<timestamp>.fmt("%.3f")] %event<description>");
            }
            return @report_lines.join("\n");
        }
    }
[1] https://perl6advent.wordpress.com/2014/12/13/day-14-a-perl-6...
Frankly, I'm of the opinion that it's a good thing Perl6 hasn't come out yet. 10 years ago, I would have welcomed it. Now though, it's 2015. We have a plethora of very nice languages. Many of them are statically typed but still fairly expressive. In general, dynamic languages are still more expressive, but the gap is much narrower. It becomes a question of if the size of that gap is wide enough to justify using Perl, Python, Ruby, or etc over something safer. Personally, I'm feeling "no".
Are you not aware that Perl 6 supports optional typing? One of the design goals is to be able to exist at both ends of that gap, and fill both needs.