HackerTrans
TopNewTrendsCommentsPastAskShowJobs

Ovid

no profile record

Submissions

Larry Wall has approved renaming Perl 6 to Raku

github.com
619 points·by Ovid·7 ปีที่แล้ว·439 comments

comments

Ovid
·3 ปีที่แล้ว·discuss
I've tried to push entity-component-systems (ECS) for non-game applications. A financial company in London took that advice to manage the complexity of their system since it was such a good fit.

For those who are curious, here's a very brief introduction to ECS: https://dev.to/ovid/the-unknown-design-pattern-1l64
Ovid
·3 ปีที่แล้ว·discuss
This was brought up a few times. There were several issues with that approach.

* `bless` and `class` aren't topologically equivalent: you can't twist and warp one into the other

* We've seen small, incremental steps get beaten to death by bike-shedding every step

* Sometimes it's hard to see the big picture when you're looking at the individual details

It's that first point that's really the killer here. Perl used `bless` and `@ISA` ("we have methods" and "here's where to find them") and that was all.

You want state? Figure it out.

You want encapsulation? Figure it out.

You want to work around MRO bugs? Figure it out.

You want to know if something in the symbol table is a subroutine or a method? Figure it out.

You want composition? Figure it out.

Much of what we wanted just couldn't be easily done building on a broken foundation, but there's so much excellent work out there which already solves these problems for class-based OO, we decided to take advantage of what others have already learned.
Ovid
·3 ปีที่แล้ว·discuss
And in the new class syntax, when it's done, that's (roughly):

    class Point {
        field $x :param :reader;
        field $y :param :reader;

        method as_string() {
            return "($x,$y)";
        }
    }
    my $origin = Point->new( x => 0, y => 0 );
    say $origin->as_string;
I know which of the two I'd rather write :)

The main limitation is that we don't have the `isa => 'Int'` check. That's largely because adding types is something for the entire language, not just this new syntax, so it had to be delayed.
Ovid
·4 ปีที่แล้ว·discuss
> A senior member of Ethiopia's media accused Facebook of “just standing by and watching this country fall apart”.

Why the hell does one company get hold so much power in the world? More to the point, why does Mark Zuckerberg, an apparently immoral man-boy, get to make decisions like this?

Remember when Myanmar used Facebook to coordinate/incite genocide? https://www.nytimes.com/2018/10/15/technology/myanmar-facebo...

Or when Facebook was being used in Kenya to orchestrate vigilante murders? https://www.bbc.com/news/world-africa-47805113

Or how about when Zuckerberg refused to introduce any controls to livestreaming after the New Zealand mosque massacre was livestreamed? https://www.thewrap.com/mark-zuckerberg-defends-facebook-liv...

Facebook only reluctantly banned white supremacists groups. https://www.nbcnews.com/tech/tech-news/facebook-bans-white-n...

Or how about in 2016 when a young man's murder was livestreamed and Facebook refused to take down the stream "because it doesn't violate the company's community standards." https://money.cnn.com/2016/06/17/technology/facebook-live-sh...

How the hell did we get into such a dystopian hellscape where one company so brazenly, openly, supports evil? Cyberpunk as a genre is dead because it's no longer fiction.
Ovid
·7 ปีที่แล้ว·discuss
Red looks interesting. Though I don't like the mapping of tables to "model". In general, I find that a model should be a consumer of an ORM, not the ORM itself. Otherwise, you expose to much to the business layer and it's harder to refactor.

For example, if you have a column on table A and you later need to move that to table B, a clean model can encapsulate that change. Hard to do when the ORM is being treated directly as the model.
Ovid
·7 ปีที่แล้ว·discuss
I get hired all the time to fix legacy systems in Perl or to build new systems in Perl.

We're still out there, but it's not "cool" to talk about.
Ovid
·7 ปีที่แล้ว·discuss
The https://taustation.space/ game runs great on Perl 5, but yes, with a robust Perl 6, many things would have been easier to implement. But by "robust" I don't mean just the language—I also mean the ecosystem.

There is no DBIx::Class (or related schema loader) for Perl 6. I don't know how mature the web frameworks are. Or even basic stuff like Excel reader/writers (we use lots of Excel for backend data analysis).

On the other hand, most of the async stuff we currently use can be thrown out. With raku's gradual typing, our in-house type libraries can be tossed out. Our local modules for making it easier to write clean procedural and OO code could be thrown out.

And the raku code would be far more concise and easy to read. Here's a simple Point object in Moose:

    package Point {
        use Moose;
        use overload '""' => \&Str, fallback => 1;
        use Moose::Util::TypeConstraints;
        subtype "PointLimit" => as 'Num'
            => where   { $_ >= -10 && $_ <= 10 }
            => message { "$_ must be a Num between -10 and 10, inclusive" };

        has [qw/x y/] => (
            is       => 'rw',
            isa      => 'PointLimit',
            required => 1,
        );

        sub Str {
            my $self = shift;
            return sprintf "[%f,%f]" => $self->x, $self->y;
        }
    }

raku:

    class Point {
        subset PointLimit of Rat where -10.0 .. 10.0;
        has PointLimit $.x is rw is required;
        has PointLimit $.y is rw is required;
    }
And for those who don't "grok" the above, here it is in Python 3, just so you can see how clean raku's OO syntax is:

    class PointLimit:
        def __init__(self, name):
            self.name =  name
        def __get__(self, point, owner):
            return point.__dict__.get(self.name)
        def __set__(self, point, value):
            if not -10 < value < 10:
                raise ValueError('Value %d is out of range' % value)
            point.__dict__[self.name] = value

    class Point:
        x = PointLimit('x');
        y = PointLimit('y');

        def __init__(self, x, y):
            self.x = x
            self.y = y

        def __str__(self):
            return "[%f,%f]" % (self.x, self.y)
Ovid
·7 ปีที่แล้ว·discuss
This has been a huge deal for the Perl community.

First, it was thought that Perl 6 would be the replacement for Perl 5.

But it was long ago recognized that there was no clear upgrade path from Perl 5 to Perl 6, so it was agreed that Perl 6 was a "sister" language to Perl 5 rather than the successor.

Except that many people expected that Perl 6 would be the replacement, so that stalled many projects. So an "alias" for Perl 6 was created, but that didn't seem to help.

Larry has now agreed with the change and Perl 6 will be renamed to "raku" and Perl 5, which has regular, major releases every year, will now be able to simply be "Perl" and be free to continue on its own way.

If I had my choice, I'd program in raku because it's a lovely language addressing many pain points (including being one of the few dynamic languages with a working concurrency model). But it's not adopted widely enough yet for that to happen. Time will tell ...