Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^5: Modernizing the Postmodern Language?

by WaywardCode (Sexton)
on Jun 30, 2020 at 15:51 UTC ( [id://11118726]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Modernizing the Postmodern Language?
in thread Modernizing the Postmodern Language?

My general recommendation is that you should start all code with those two pragmata.

Before I am too misunderstood, let me be clear that I agree with the recommendation. I disagree with flipping the defaults that have been in place for decades and telling people code which doesn't work under the new defaults is bad code.

Forget strict, look at what they are proposing with changing the syntax for prototypes. Are you telling me it's impossible to add signatures to the language without changing prototypes? I don't buy that. It might not come out as pretty, but for a language as old as perl, compatible is worth more than pretty. It boggles my mind that they call out postfix dereferencing as a benefit of perl7 in the p7 announcement post, since that doesn't need any feature flags in perl today:

perl -e '$x = [1,2,3]; print $x->@*'

...which makes it a great example of how you can innovate in the language while respecting what it already is.

Replies are listed 'Best First'.
Re^6: Modernizing the Postmodern Language? (Autobox)
by LanX (Saint) on Jun 30, 2020 at 17:51 UTC
    I never understood why people prefer this ugly postfix syntax over autoboxing methods

    ${nested}{arrayref}->push(4)

    is certainly more readable and shorter than

    push @{ ${nested}{arrayref} }, 4

    or

    push ${nested}{arrayref}->@*, 4

    And ->@* should be aliased to ->list or ->arr

    Perl 4 started as "bash on steroids", it immediately convinced Sysops to have a better designed language with sed and awk semantics included.

    But today's ubiquitous language is JavaScript.

    The strategy should be to aim at a "JS on steroids".

    And JS has autoboxing.

    See also autobox on CPAN.

    Autoboxing could be a killer feature when marketing v7 or v8 as more readable advancements.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

    Update

    And please don't tell me it's not possible to fix the speed penalty with special opcodes for a handful of built in methods.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11118726]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-25 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found