Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: getting rid of special features

by Anonymous Monk
on Feb 17, 2013 at 14:32 UTC ( #1019143=note: print w/ replies, xml ) Need Help??


in reply to Re^2: getting rid of special features
in thread getting rid of costly special features

These side-effects make translating Perl5 to other languages a pain in the *ss.

And you've lost me :) translating perl to other languages shouldn't guide the design of perl, come on


Comment on Re^3: getting rid of special features
Re^4: getting rid of special features
by moritz (Cardinal) on Feb 17, 2013 at 15:23 UTC

    You are right mostly about that, but there are other reasons to abolish them.

    They make Perl 5 harder to learn, harder to write correctly, harder to read and contribute to its reputation as a language full of cruft.

    The fact that they make it harder to translate Perl 5 to other languages is at first merely another symptom of the problem. But if Perl 5 doesn't want to be tied to the C world forever, and wants to explore other environment (JVM/dalvik-only mobile phones and browsers, just to name two appealing ones), the lack of portability that those features introduce becomes a problem on its own.

      the lack of portability that those features introduce becomes a problem on its own.

      come on now, we're talking about autoincrement here, its as trivial as it gets

Re^4: getting rid of special features
by LanX (Canon) on Feb 17, 2013 at 20:03 UTC
    JS is nowadays not only the most widespread language...

    ... because of its minimality one should think of it as a VM with incredible efficient JIT performance.

    Now think of benchmarks where a "python2js" conversion runs 10 times faster than a "perl2js" because you can't use ++ but you need a method inc(), which has to handle a special case which is only known to a little minority of people ...

    Wouldn't you love to have a pragma telling the compiler: No Sir, I don't need that magic here! ?

    Cheers Rolf

    UPDATE: added quotes.

      What are you talking about, got link?

      "Wouldn't you love to have a pragma telling the compiler: No Sir, I don't need that magic here! ?

      ... or just run perl2js --opt assume_increment_is_numeric=1

      package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
        For the records I didn't mean any specific "perl2js" or "python2js" implementation.

        > ... or just run perl2js --opt assume_increment_is_numeric=1

        ATM his is the only mode that perlito knows!

        But if you need to be sure that the Perl¹ side does the same thing, you will end up in overloading ++, hence considerably slowing down the Perl side.

        Cheers Rolf

        ¹) is there any name for the standard interpreter/compiler? "CPerl" maybe? ;)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2014-12-25 10:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls