Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Keep It Simple, Stupid
 
PerlMonks  

Re^2: getting rid of costly special features

by LanX (Abbot)
on Feb 18, 2013 at 10:12 UTC ( #1019311=note: print w/ replies, xml ) Need Help??


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

> And as for it being a barrier to porting to JavaScript VMs. Its not that complicated an algorithm.

Not complicated but very slow.

It considerably slows down any numeric increment, which are >99% of the use cases.

> magical string increment was removed from perl,

I didn't say that, I just want a switch to turn it off.

Cheers Rolf


Comment on Re^2: getting rid of costly special features
Re^3: getting rid of costly special features
by BrowserUk (Pope) on Feb 18, 2013 at 10:19 UTC
    Not complicated but very slow. It considerably slows down any numeric increment

    Care to back that assertion up with some evidence?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      > Care to back that assertion up with some evidence?

      Strings are immutable in JS, now how would you implement a postincrement?

      Instead of i++ of a primitive value i, you need to use objects for all scalars with methods like i.postInc() and i.preInc() and i.getValue()

      Cheers Rolf

        Essentially what you are arguing is that we should change the Perl5 language and interpreter so that you can replace it with another interpreter written in Javascript. Which is ....!

        Besides which, in order to preserve Perl5's semantics, you would have to have a scalar type that could represent integers, floats, strings and references. Ie. You would have to box your ints.

        Here you are saying that to do so would make things too slow; and yet it is only a few months since you were advocating autoboxing everything in Perl for the sake of some OO ideology, and hang the (enormous) performance hit.

        There's nothing like consistency. And that's nothing like it :)


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (15)
As of 2014-04-16 17:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (433 votes), past polls