in reply to Rindolf, Perl 6 and Wish lists

As I read through these points, all I could think of what "what a peculiar collection of features." I daresay my own ideas for extending Perl 5 (keeping Perl 5 Perl 5?) would take it off in another wild tangent. But some of these points seem... worng to me. What a mishmash of ideas. Let's have a look...

  1. Dot or arrow? I am getting used to the dot.

  2. Classes. Huh?

  3. on_destroy(). If you need it, you need it bad, I suppose. But the name should be UPPERCASED.

  4. Globs will be replaced by return values. I can't parse that statement in any sensible way.

  5. local has its uses, in terms of overlaying a temporary value on a variable. When you need it, you need it bad.

  6. I have never had a hash mishap with , and/or =>. Again, I don't see the point.

  7. Proper tail recursion. Because it doesn't work correctly at the moment? Maybe so, but as I never use recursion except when playing I don't see this as a burning issue.

  8. Factories. Again, maybe I'm missing something. I suppose I should reread my Gang of Four, but this doesn't do anything for me.

  9. x operator? What, that one must employ the correct use of space? Well ok, but it's not something I lose sleep over.

  10. s/scalar/count/. That's an entirely gratuitous and subjective change.

hmmm. When you look at it that way, it doesn't seem like such a big deal. Thanks for posting the information. At least I know now I can safely ignore Rindolf :) As far as I can tell, most of these issues are just stylistic, and so the idea is just to bend Perl to be more suited to writing a particular sort of Perl.

<update> And now that I've read the use.perl.org thread I know I can safely dismiss the whole idea as the work of a nutcase. Sorry, but the guy is really off the wall. </update>

As for what directions I'd like to see Perl 5 taking, I wish things like this would work:

Those are two issues that bit me yesterday (hi japhy!). Although AFAIK these problems are emminently unfixeable because of other constraints.


print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'

Replies are listed 'Best First'.
Re: Re: Rindolf, Perl 6 and Wish lists
by demerphq (Chancellor) on Feb 15, 2002 at 11:10 UTC
    And now that I've read the use.perl.org thread I know I can safely dismiss the whole idea as the work of a nutcase. Sorry, but the guy is really off the wall.

    Thank you.

    You have articulated my thoughts so much better than I could.

    When I read the thread all I could think is "This guy wants to remove everything he doesn't understand, and replace them with other things that he doesnt understand."

    In my experience the majority of non CS professors that go around harping about tail recursion dont have a clue what they are on about...

    Yves / DeMerphq
    --
    When to use Prototypes?

      I may be a little dense (or I just didn't have the proper edumication) ... What's a good definition of tail-recursion? When is it used?

      ------
      We are the carpenters and bricklayers of the Information Age.

      Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

        Tail recursion is the most trivial form of recursion. It is when the last statement in a function/subroutine calls itself. (Or more complicated when the last statement calls another function whose last statement calls the first... etc).

        The reason I say trivial is becuase it is the form of recursion that can be easily mechanically converted into iteration. As most programmers know there is nothing that can be implemented using recursion that cant be implemented using iteration (and usually way more efficiently), but that some algorithms are far more suited to one or the other.

        A good example would be a breadth first versus depth first traversal of a data structure. BF is far easier to code as an iterative function and DF as a recursive function.

        So why does all this matter? Well, because Tail Recusion is used in many languages that do not want to provide proper looping structures. So when the language encounters tail recursion it internally converts it to the far more efficient iteration, transparently to the user.

        Optimizing compilers will when they see a function that looks like this:

        sub foo { my $x=shift; #code.... foo($x+1); }
        will usually optimize it into something like this:
        sub foo { my $x=shift; START_OF_FOO: #code $x++; goto START_OF_FOO; }
        Which avoids the overhead of the stack, and is thus much more efficient.

        The rub of this is that "Tail Recursion" is one of those jargony terms that people that dont know that much love to throw around without realizing that they are talking about something that is in essence trivial and or obvious or whatever.

        Oh and the reason you probably dont hear much about it in the perl world is that we have plethora of excellent looping structures, and we use them. However I seem to recall hearing that perl does handle Tail Recursion optimization, so use it if you wish.

        Anyway, heres a couple of links regarding tail recursion... Some of them probably dont entirely agree with my opinion, but thats a good thing. :-)

        Dictionary of Algorithms and Data Structures

        A lispy point of view

        Jargon ref

        Even better jargon :-)

        A good one (takes a while to load though, be patient.

        Yves / DeMerphq
        --
        When to use Prototypes?

Re: Re: Rindolf, Perl 6 and Wish lists
by steves (Curate) on Feb 15, 2002 at 05:54 UTC

    People that dislike local don't understand its extreme usefulness IMO. What they don't like about it (again IMO) is that it doesn't fit any other scoping used in more mainstream languages. It's so absolutely perfect for doing things like changing the disposition of signals or changing where output goes from a given calling point on down. Why would anyone think it necessary to get rid of such a useful construct?