Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Beyond Golf - reading between the tokens

by gjb (Vicar)
on Dec 28, 2002 at 01:27 UTC ( #222662=note: print w/ replies, xml ) Need Help??


in reply to Beyond Golf - reading between the tokens

  1. That will cost you a penny ;-)
  2. Such a competition would be nice since it's more "semantic" than "pure golf" and should yield nicer code.
  3. What about the semi-colon, I'd guess it doesn't count? It should be possible to automate the count using a lexer for Perl if it isn't sensitive to $$a[0] vs. $a->[0] et al. differences.
  4. How about Croquet?
  5. At least 5, but I guess you held back a little ;-)

How about Polo, getting the task done fastest using Benchmark.pm?

Just my 2 cents, -gjb-


Comment on Re: Beyond Golf - reading between the tokens
Select or Download Code
Re^2: Beyond Golf - reading between the tokens
by Aristotle (Chancellor) on Dec 28, 2002 at 01:39 UTC

    The semicolon is an interesting case. I'm leaning towards not counting it, as I can't think of a case where the shorter of two solutions would turn out to be longer depending on semicolon sensitivity. If such a case exists, this would take further thought.

    As for automated counting, my idle musing was to abuse the Perltidy code for that purpose.

    I don't like the Benchmark.pm idea - you'd have to specify the exact environment (Perl version+patches, OS, hardware, modules' versions) to be able to decide on a reproducibly and unambiguously winning entry. It's just too fickle a goal.

    Makeshifts last the longest.

      The Benchmark.pm idea could be done if the code were submitted to run on a particular computer, if someone is crazy enough to risk something like that ;-)

      Seriously, it could be done in the sense that everyone is able to confirm the results on his own machine with its specific setup. The format of submission would be a function that can be run using Benchmark so that the "competition" could be compared by just pasting the code and running the benchmarks.

      I agree that you won't see a clear winner, but it would give those of us interested in raw performance a number of alternative implementations and hence an opportunity to learn. It's all about taking part, not about winning ;-)

      Just my 2 cents, -gjb-

      Update: It would be possible to get a machine/OS/etc. independent comparison by using some "gauge code", ie. a standard piece of code. The benchmark for the Perl Polo code would then be calculated proportional to the time it takes the "gauge code" to execute.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2014-09-17 20:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (98 votes), past polls