Polynomial Division Challenge

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Polynomial Division Challenge

Ken G. Brown
Here's a chance for you whizzes to give Squeak some positive exposure:

Polynomial Division Challenge
<http://codegolf.com/polynomial-division>
<http://codegolf.com/leaderboard/competition/polynomial-division/>

Wouldn't it be great to see Squeak in the top spots?

Ken G. Brown

Reply | Threaded
Open this post in threaded view
|

Re: Polynomial Division Challenge

Bert Freudenberg
On Jul 12, 2007, at 8:37 , Ken G. Brown wrote:

> Here's a chance for you whizzes to give Squeak some positive exposure:
>
> Polynomial Division Challenge
> <http://codegolf.com/polynomial-division>
> <http://codegolf.com/leaderboard/competition/polynomial-division/>
>
> Wouldn't it be great to see Squeak in the top spots?

"You're not just limited to Perl either - PHP, Python and Ruby are  
all available too."

Besides, competing on "number of keystrokes"? Not too useful a  
measure IMHO.

More positively, I *do* think we should make stdin/stdout/stderr  
easily accessible from the default image. FilePlugin should provide  
that.

- Bert -




Reply | Threaded
Open this post in threaded view
|

Re: Polynomial Division Challenge

Blake-5
On Thu, 12 Jul 2007 01:48:42 -0700, Bert Freudenberg  
<[hidden email]> wrote:

>
> "You're not just limited to Perl either - PHP, Python and Ruby are all  
> available too."

What, no REXX?

Reply | Threaded
Open this post in threaded view
|

Re: Polynomial Division Challenge

Alexander Lazarevic'
Blake schrieb:
>> "You're not just limited to Perl either - PHP, Python and Ruby are all
>> available too."
> What, no REXX?

What, no Maple nor Mathematica?

Reply | Threaded
Open this post in threaded view
|

Re: Polynomial Division Challenge

Mark Miller
In reply to this post by Ken G. Brown
Ken G. Brown wrote:
"Here's a chance for you whizzes to give Squeak some positive exposure:

Polynomial Division Challenge
<http://codegolf.com/polynomial-division>
<http://codegolf.com/leaderboard/competition/polynomial-division/>

Wouldn't it be great to see Squeak in the top spots?"

Yeah it does look interesting. Unfortunately they don't allow code in any languages besides Perl, PHP, Python, and Ruby. I went to their "submit entry" page, and that's all they allow you to select for the language. There's no "other" category. Pity.

I mean, it makes sense in a way. They have their language setup all preconfigured so all you have to do is submit code, not the whole development environment, which is essentially what they'd have to allow you to do if they allowed submissions in any language.

It looks like they have the whole testing setup automated. That's the reason they want input in stdin and output in stdout. They can just run the test as a batch job as soon as you submit your code. You can submit code multiple times as well, and check back and see what their test results were. They limit you to one submission every 2 minutes, so it sounds like the testing goes in rapid fire fashion.

According to the site, their language selection is actually less restrictive than before. They say Code Golf is based on another site called Perl Golf, which I assume only accepted Perl code.

In any case, there's nothing saying we couldn't take the problems they pose, write them up in Smalltalk and compete outside the site, comparing against their stats. We just wouldn't be able to submit them to Code Golf. It takes the fun out of it a little when you're essentially preaching to the converted.

>From what I hear, Smalltalk has gotten exposure in the Code Katas series, which is essentially the same thing, solving problems with code.

---Mark
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Polynomial Division Challenge

Mark Miller
In reply to this post by Ken G. Brown
I just checked on their forums and there is a discussion thread titled "More Languages!" under the "Feature Suggestions" category. You have to sign up (free) to post to the forums. If people are interested, pipe up. I put my 2 cents in for Smalltalk.

The other languages suggested by other participants in the discussion were: Haskell, J, Scheme, Postscript, Darcs, Io, Lua, AWK, and Java. Scheme and Haskell got the most support from the others in the discussion. The discussion got started almost a year ago, and it seems like there's been no movement on any of the suggestions, though there hasn't been much interest in the topic. Only 11 comments before I posted mine.

There was a suggestion to talk to carldr directly on the Code Golf IRC channel (however you get to that) about additional languages. It sounds like he's the guy running the site, and it looks like he participates in the forums from time to time.

---Mark
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Polynomial Division Challenge

Nicolas Cellier-3
In reply to this post by Mark Miller
For fun, just put a GolfPolynomDivision in VW public store and at squeak
source http://www.squeaksource.com/GolfPolynomDivision.html.

10000 bytes in lengthy VW xml with few comments and lenghty explicit
method  variable and class names. 7700 in traditional chunk, test included.

A factor 10 to 20 would be gained without effort, by just renaming.
Then it's getting harder.
Core algorithms for Reading/Dividing/Printing polynoms have to be improved.

Other things make Smalltalk a bad candidate for such silly games.
1) Base library names are long : having something like +, & , or <
instead of aStream nextPutAll: would help shorten a lot.
2) Class creation methods are lengthy...
3) Categories are useless for this kind of test and spoil byte-efficiency...

I did not fulfill stdin/stdout requirement. This is a must add in
Squeak, VW and other Smalltalks.

I feel like best candidate would be GNU smalltalk to compete against
these Ruby/Python/PHP/Perl oriented rules. Beside, it could be automated
on their site.

Of course, as Bert already said, the goal is stupid from the code
quality point of view. It leads to uggly unreadable code. Not the
Smalltalk spirit. But if you want to play, the repository is open for
write...

Nicolas


[hidden email] a écrit :

> Ken G. Brown wrote:
> "Here's a chance for you whizzes to give Squeak some positive exposure:
>
> Polynomial Division Challenge
> <http://codegolf.com/polynomial-division>
> <http://codegolf.com/leaderboard/competition/polynomial-division/>
>
> Wouldn't it be great to see Squeak in the top spots?"
>
> Yeah it does look interesting. Unfortunately they don't allow code in any languages besides Perl, PHP, Python, and Ruby. I went to their "submit entry" page, and that's all they allow you to select for the language. There's no "other" category. Pity.
>
> I mean, it makes sense in a way. They have their language setup all preconfigured so all you have to do is submit code, not the whole development environment, which is essentially what they'd have to allow you to do if they allowed submissions in any language.
>
> It looks like they have the whole testing setup automated. That's the reason they want input in stdin and output in stdout. They can just run the test as a batch job as soon as you submit your code. You can submit code multiple times as well, and check back and see what their test results were. They limit you to one submission every 2 minutes, so it sounds like the testing goes in rapid fire fashion.
>
> According to the site, their language selection is actually less restrictive than before. They say Code Golf is based on another site called Perl Golf, which I assume only accepted Perl code.
>
> In any case, there's nothing saying we couldn't take the problems they pose, write them up in Smalltalk and compete outside the site, comparing against their stats. We just wouldn't be able to submit them to Code Golf. It takes the fun out of it a little when you're essentially preaching to the converted.
>
>>From what I hear, Smalltalk has gotten exposure in the Code Katas series, which is essentially the same thing, solving problems with code.
>
> ---Mark
> [hidden email]
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Polynomial Division Challenge

Mark Miller
In reply to this post by Ken G. Brown
nicolas cellier wrote:
"Other things make Smalltalk a bad candidate for such silly games.
1) Base library names are long : having something like +, & , or <
instead of aStream nextPutAll: would help shorten a lot.
2) Class creation methods are lengthy...
3) Categories are useless for this kind of test and spoil byte-efficiency...

I did not fulfill stdin/stdout requirement. This is a must add in
Squeak, VW and other Smalltalks.

I feel like best candidate would be GNU smalltalk to compete against
these Ruby/Python/PHP/Perl oriented rules. Beside, it could be automated
on their site.

Of course, as Bert already said, the goal is stupid from the code
quality point of view. It leads to uggly unreadable code. Not the
Smalltalk spirit. But if you want to play, the repository is open for
write..."

Hmm! I see what you're saying. You make a really good argument against Code Golf. After I read your note I thought to myself, "Well it was based on Perl Golf for crying out loud." I felt kind of dumb not seeing that as a red flag. I paid a little attention to the metrics that were used, like "keystrokes", but I didn't fully consider their implications. You're right. It just encourages ugly code. When I looked at the stats of the "top 10" winners in the Polynomial Division problem, I noticed that the Ruby and Perl versions were winning out over the Python versions. I've read that Pythoners tend to be more concerned with a "correct way to do things", which puts them at a disadvantage using this sort of criteria. You're right that things like the length of method names can also put a program at an advantage or disadvantage in the rankings.

Oh well. Sorry I suggested it.

As I was responding here, I was trying to imagine a programming contest that measured what is truly valuable about programming. It seems to me that one would have to have human judges, not a machine doing objective measurements, and they would need to measure more than "does the program work?", and "does it run in a reasonable amount of time?" (which is important), but also look at best practices like how well does it implement encapsulation, how concise is it, and how good are its abstractions. But then they'd be rather objective, wouldn't they? They'd be like figure skating competitions. They try to keep scoring as objective as possible, but you can't help the subjective judgements that inevitably enter into it.

The last time I participated in a programming contest was many years ago. The ACM held them every year. They were time trials, and really all they did was run test code through the programs and see if they produced correct output. The source code could've been complete gibberish as far as they were concerned. I always liked the challenge (even though I consistently scored low by their criteria), but I didn't like the emphasis on "get it done as fast as possible".

---Mark
[hidden email]