News for hackers. Stuff that matters.
Re:Perl 7 is going to be Perl 5.32, mostly by jqcoffey on Wednesday June 24, 2020 @12:57PM (#23630594)
Ok, so I wrote tons of Perl and am to this day a fan, but I don’t think one can call a blessed hash (or scalar for the fancy folks) an object _system_.

It is flexible and fun and I do miss it.

True story: years of passing functions to other functions and map/greps made the switch to FP Scala (another language I fear will die) a lot easier!

Re:Perl 7 is going to be Perl 5.32, mostly by jlokier on Wednesday June 24, 2020 @01:46PM (#23631301)
> I don’t think one can call a blessed hash (or scalar for the fancy folks) an object _system_.

Perl first, then JavaScript.

Did you know JavaScript classes are blessed hashes?

They even take about the same amount of syntax. ("__proto__" vs "blessed", "prototype" vs "bless").

Old JavaScript made the blessing crude and obvious.

Modern JavaScript lets you hide it in a "class" decleration. Which you can also do in Perl if you want (though you'll need to choose a module for this, and people generally prefer a different approach to dressing up objects in Perl.)

There's still a blessed hash under the hood which you can see and kind of have to be aware of... in both languages.

Re:Perl 7 is going to be Perl 5.32, mostly by daotoad on Wednesday June 24, 2020 @05:36PM (#23634161)
Perl and JavaScript both give you a minimally specified set of tools you can use to build your own more advanced object system.

IMO, that's why both languages have been able to be extended and adapt so much.

If you look at tools like Moo and Moose in Perl and the different coding paradigms that evolved in JS before the "class" keyword was standardized, this is pretty clearly evident.

JS has had the advantage of a standards committee pushing new language features aggressively. Perl has moved more slowly, keeping a majority of functionality in libraries.

Re:Perl 7 is going to be Perl 5.32, mostly by jqcoffey on Wednesday June 24, 2020 @07:35PM (#23635086)
> Did you know JavaScript classes are blessed hashes?

> They even take about the same amount of syntax. ("__proto__" vs "blessed", "prototype" vs "bless").

omg, I totally forgot that (I left day-to-day JS use a good decade ago, sorry!).

Re:Perl 7 is going to be Perl 5.32, mostly by lmm on Wednesday June 24, 2020 @09:17PM (#23635813)
Traditional JavaScript has a notoriously poor object system yes. If those are the only two languages you know then I guess Perl's object system doesn't seem so bad, but that shouldn't be a defense of either language.
Re:Perl 7 is going to be Perl 5.32, mostly by cutler on Wednesday June 24, 2020 @01:36PM (#23631168)
I've heard Python's object system isn't that different under the hood.
Re:Perl 7 is going to be Perl 5.32, mostly by phone8675309 on Wednesday June 24, 2020 @02:30PM (#23631945)
You even have the same boilerplate of the first argument to a class member function being the object itself.
Re:Perl 7 is going to be Perl 5.32, mostly by cutler on Wednesday June 24, 2020 @02:35PM (#23632020)
Yes. I was thinking mainly of Perl's symbol table which I believe is also how OO is implemented in Python.
Re:Perl 7 is going to be Perl 5.32, mostly by daotoad on Wednesday June 24, 2020 @05:32PM (#23634108)
My understanding was that Perl's OO system was directly inspired by Python's. I can't find a source on that though.
Re:Perl 7 is going to be Perl 5.32, mostly by cutler on Wednesday June 24, 2020 @05:55PM (#23634312)
Other way round I think.
Re:Perl 7 is going to be Perl 5.32, mostly by bmn__ on Thursday June 25, 2020 @08:46AM (#23640036)
Nope. http://www.perl.com/pub/a/2007/12/06/soto-11.html

> I don’t really know much about Python. I only stole its object system for Perl 5. I have since repented.

Re:Perl 7 is going to be Perl 5.32, mostly by Discombulator on Thursday June 25, 2020 @08:36AM (#23639941)
Very similar story here; I barely write any Perl nowadays but am still very fond of it.

I especially like the sigils - they serve in a way as a primitive type system and actually convey useful information when reading code. I suspect people who complain about them are the same who dislike strong typing.

Interestingly, like you, nowadays I am very fond of Scala.