Slashdot Mirror


White Camel Award Nominations

Idmat writes "Nominate the Perl community's unsung heroes for the first White Camel awards. Three awards--for outstanding contributions to Perl Advocacy, Perl User Groups, and the Perl Community--will be awarded at O'Reilly's Perl Conference 3.0 on August 24, 1999. Nominate the folks who have made these important non-technical contributions to Perl at perl.com All nominations must be in by August 2. The White Camel awards are sponsored by Perl Mongers, O'Reilly & Associates, and sourceXchange. See the press release for more info " Anyone want to share their ideas?

9 of 76 comments (clear)

  1. Re:abigail by washort · · Score: 2

    Hear, hear, Abigail's Perl prowess is well known throughout the USENET community. :)

    A small example of her handiwork, if I may:

    sub A::TIESCALAR{bless\my$x=>A};package B;@q=qw/Hacker Another
    Perl Just/;use overload'""'=>sub{pop @q};sub A::FETCH{bless\my
    $y=>B}; tie my $shoe => 'A';print "$shoe $shoe $shoe $shoe\n";

  2. Re:Perl sucks / php3 rules by Tom+Christiansen · · Score: 2
    For dynamic generated html, that's it.
    Without providing substantiating evidence, I'm afraid that your blithe remark comes off as either disingenuous or underinformed. You can hardly tell Slashdot.org or Deja.com that they aren't getting a tremendous productivity, performance, portability, programmability, and maintanability win through using Apache + mod_perl + Perl for their dynamic HTML generation.

    To be fair, you should actually compare the technologies -- and not in your Prisoner Of Bill little box, either. Feel free to post, and we'll be happy to show you how underwhelming PHP is compared with dynamic Perl solutions.

    Those of you who haven't seen Writing Apache Modules in C and Perl", by Dr. Dr. [he has too many degrees :-] Lincoln Stein and Doug MacEachern, really should check it out.

  3. Re:Python loses by Tom+Christiansen · · Score: 2
    That's what I'd like to know: what can you do in Perl that you can't do in Python? My guess is nothing.
    You're not just wrong -- you're massively and pathetically wrong. A tiny list is enclosed below.
    As for what you can do in Python that you can't do in Perl: Python code is actually maintainable. Perl code generally isn't. And Perl makes it hard as hell to make code that even comes close to readable.
    The more times you repeat that lie, the less reasonable you sound. Please see my other response for why you have no idea what you're talking about. If you write bad perl code, it's your own fault for being imcompetent.

    Now, what can Perl do that Python cannot do? I don't know what you're looking for here. There's a remarkably long list of things you can't do in python than you can do in Perl. Some of these are severe. Others are not.

    • With python, the object is the way, the truth, and the light. Let no man cometh unto his data save through the object. In perl, OO is an option, not a requirement.
    • With python, you cannot pass in chunks of anonymous code and access variables in that code chunk in the correct scope. That's because Python has no understanding of proper closures. Perl does.
    • With python, you cannot generate C code to compile into an a.out.
    • With python, the pattern matching is not tightly integrated into the language. It is merely loosely bolted on, which introduces inefficiencies and quoting clumsinesses.
    • With python, class methods and object methods are treated dissimilarly. This is unclean.
    • With python, you cannot access your overridden superclass's method in a portably symbolic fashion -- there's no SUPER or super().
    • With python, you cannot implement a class in whatever way makes sense to you. You must use its system. That means, for example, that you cannot use a closure as an object. No big surprise, I suppose. Python never did figure out closures.
    • With python, you cannot correctly garbage collect lost circular references when the interpreter thread shuts down. This makes it completely unsuitable for use in embedded applications. It fails to follow proper finalizer semantics for things it forgets about!
    • With python, you cannot tie arbitrary semantics to variables and handles through the tie machanism to trigger implicit object calls.
    • With python, you cannot set watch points on variables.
    • With python, you cannot catch compile-time errors using function prototypes.
    • With python, you cannot determine your calling context, nor behave differently dependent upon the same.
    • With python, writing an eval string is a pain in the royal butt due to the insane whitespace problem.
    • With python, you have significantly less control of compile-time versus run-time issues. Yes, this matters.
    • With python, you have no equivalent to CPAN or the CPAN.pm module to support a system for automatatic registration, distribution, replications, and installation of 3rd-party modules.
    • With python, you cannot write poetry, because of the white space issue -- again.
    • With python, you have no equivalent to Apache's mod_perl.
    There are doubtless many others. These are just off the top of my head. You should visit the Perl OO links I gave in a different followup so you actually know what you're talking about next time.
  4. Re:What are you people smoking? Re:Hear, Hear! by Tom+Christiansen · · Score: 2
    You can readily tell at a glance what "part of speech" the identifier is functioning as. The $ for "this" versus the @ for "these" is a useful distinction that allows Perl programmers faster
    Huh? Faster what?
    Faster understanding of who's frobbing whom, and how.
    Is there a way to pass around an object that may be an array, or a string, or an associative array?
    Of course. Use a reference. Or an object. This is a win for homogeneity, but a loss at compile-time type-checking. Some of us like that kind of thing. I guess you don't.

    In fact, a Perl function can dynamically determine at run time:

    • the number of arguments passed to it
    • the precise or abstract types of each of those arguments
    • whether its return value is expected to be zero (void context), one (scalar context), or multiple values (list context).
    This is virtually impossible in any other programming language. It's completely laughable in C, and even Python is lacking the cojones to do it.
    It is easy to perform string interpolation, as in "these $count cats".
    It's also correspondingly difficult to determine what will happen to the contents of a quoted string.
    I don't know what you're smoking kid, but you definitely need to lay off. Your trollisms are leaking through. Let's see now:
    Perl: print "these $count cats"
    Perl: printf "these %d cats", $count
    C: printf("these %d cats", count)
    Python: print "these %d cats" % count
  5. Re:A Challenge for Tom by Tom+Christiansen · · Score: 2
    I love the way you define as "irrelevant" the things that you just can't do. Where's your the C code that I can generate and you can't? How about the way you can lose objects in Python and never call their finalizers when the program exists? That's fundamentally broken.
    How about this: find your most readable piece of Perl code that you think can't be easily reimplemented in Python. Post it here. Nothing silly like executing chunks of Perl code allowed. It's just as hard for Perl to execute chunks of Python code.
    Go to town:
    sub timeout {
    my($period,$closure) = @_;
    alarm($period);
    $closure->(); # indirect function call
    alarm(0);
    }

    my $line = '';
    timeout(30, sub { $line = readline(*STDIN) });

    # now check $line for proper contents
    print $line;

    You can't do it. You don't have proper scoping. You can't get the proper $line variable set. So instead you'll have to invent some god-awful overly obfuscated object-oriented abomination because you didn't get the language primitives right.

    Here's another for you:

    for ($i = 0; 10 > $i; $i++) {
    for ($j = 0; 10 > $j; $j++) { for ($k = 0; 10 > $k; $k++) { $a[$i][$j][$k] = $j + $k * 2 ** $i;
    }
    } } Yes, that was a complete program. Enjoy.
  6. Re:A Challenge for Tom by Tom+Christiansen · · Score: 2
    Congratulations -- you failed twice, as I knew you would.

    You failed with the closure example because you were forced to create a whole new class just to pass a bit of code in, for God's sake. Do you really have no understanding of what lexical scoping is about, or did you just want to avoid admitting that Python is fundamentally incapable of coping with treating functions as first class citizens? That was the ugliest, least readable, most cumbersome hack I can imagine. What if you had 100 different callbacks, each of which did different things and which played with different lexically scoped variables from different scopes? Don't you see how your solution is an crufty hack, and no real solution at all? You failed.

    As for the second example, I was showing you that Python is incapable of doing correct allocation on demand. Instead, you were forced to do all the dirty work the way you do it in some low-level language. Memory management is too important a task to leave up to the programmer, and too tedious a one as well. Once again, you try to present this design flaw as a feature. I'm sorry, but you're wrong.

  7. Re:A Challenge for Tom by Tom+Christiansen · · Score: 2
    But the "timeout" function I created above can also accept normal functions. As mentioned earlier, I did have a version that didn't use a separate class.
    "Normal functions" aren't good enough. When I pass in sub { $line = readline(*STDIN) } that's a closure. It find the version of $line which is currently in scope. You know, a lambda that actually works right, because it has correct scope? Python can't do that, because its idea of scope is not rich enough. Lisp, Scheme, and Perl can all do it. There is no end of gross workarounds for not having closures, but such they remain. You cannot compare simple wrapping a bit of sub{} around something to all that OO bull. It's just not the same. At all. I'm disappointed that you seem to pretend that it is.
    I notice you completely ignored my other points. I'll assume that means you couldn't think of any way to refute them.
    Bah. I don't have infinite time. You can't bait me into playing that game. And I despise the web as a conversation forum. Get thee to a newsgroup so I can use a real newsreader and a real editor, damn it. I'm tired of cutting and pasting from vi into lynx or netscrape. And I hate writing in HTML, but if I don't, it looks like shit.
    I also find it amusing that you said you were going to give me the last word,
    I said if you planned on simply being a flamer.
    That depends on what you consider to be correct. I could just as easily say that it shows Perl is incapable of doing correct runtime bounds-checking. You seem to think that "however Perl does it is the right way".
    It's all part of the "do-what-I-mean" philosophy; or, if you would, the automatic memory management philosophy. If I want to assign to a variable and there's something already there, I expect what was used to be there to get recycled properly. If I want to assign to a variable and there's nothing there yet, I expect the system to allocate space for me. In Python, I can't do the simple equivalent to:
    my @list;
    $list[$place] = some_value();
    This goes against the principle of least surprise. Why do I have to presize arrays (`lists')? I don't have to do so with strings! That's part of the beauty of implicit memory management. It drives me nuts. Why can I do this:
    a = {}
    a["fred"] = "barney"
    but I can't do this
    a = []
    a[23] = "barney"
    It just doesn't make sense. It's a pain in the butt.

    And I don't see why you allocate hashes (`dictionaries') with braces and dereference them with brackets. The queer thing is that this:

    a = {}
    a["fred"] = "barney"
    a[23] = "barney"
  8. Re:COBOL of the 90's by Tom+Christiansen · · Score: 3
    What? Spend more time writing code then trying to count the curly braces?
    You would prefer perhaps mental telepathy?

    If you're counting braces in C, Java, troff, awk, C++, Perl, Javascript or any of the rest, you're doing something fundamentally wrong. That's the computer's job. Perhaps you should try a more sophisticated editor than ed. :-) Really, balanced braces and alignment of code are the job of your editor to help you with.

  9. Re:Hear, Hear! by Tom+Christiansen · · Score: 3
    Hackish OO features are a strange brickbat to throw at Perl, because Perl5's OO-features were strongly influenced by Python's
    Very much so. Larry Wall had been using C++ for a few years before he added object support to Perl. He did so at least partially so he could interface with C++ using a simpler language.

    When it came time for the object design, he rejected much of the C++ model. That's probably just as well, since C++ has so many oddities not found in any other language with object support. Python's model seemed sufficiently clean and appealing that, as with so many other tools and languages where Larry "cherry-picked" the coolest property from eclectic sources, he took most of the object stuff from Python.

    For example, the object's self reference (the "this" pointer) coming in as the initial argument in a method call rather than as a formally defined variable comes right from Python.

    Of course, we weren't really content to stop there. One difference from Python is that the class itself can serve as something of a meta-object. This has some rather nifty ramifications to this. If you're filling out a check-list of features, you'll find that Perl OO programming supports classes and objects, single and multiple inheritance, instance methods and class methods, access to overridden methods (a virtual SUPER class), constructors and destructors, operator overloading, proxy methods via autoloading, delegation, a rooted hierarchy for all objects (class UNIVERSAL), and two different levels of garbage collection.

    Before you diss it too much, you should know what Perl OO is actually about. If you're looking for more information or examples on Perl OO, here are some suggestions:

    • The perltootc manpage, for managing class (and sometimes instance data) in Perl.
    • The perltoot manpage, a tutorial for OO in Perl
    • The perlobj manpage, a rather dry but essential page.
    • The overload manpage, to see how operator overloading works with Perl objects.

    • The Perl Cookbook (yes, my name is on the cover) has a chapter on objects. You can download the source through the Examples link there (either normal gzip or else Wintel zip format).
    • A new book (that yes, I tech-edited, but no, which I don't get royalties on) is coming out by Damian Conway, called simply enough Object Oriented Perl. Damian is our Melville. :-) We've accepted three of this prolific fellow's papers in the refereed track at the next Perl Conference. One of them is even a technical paper that's written completely in a certain kind of poetry.

    I don't mean to pretend that Perl's OO doesn't have its host of issues. The biggest one is that unless you're careful in your design, one class needs to get unnaturally chummy with its parent class to avoid accidentally overriding or interfering with not just functional members (methods) but also data members (attributes).

    But as Larry has said: `Concentrate on Perl's strengths, not its weaknesses.'