Second Annual ICFP Programming Contest 69
PsionV writes "The second annual ICFP Programming Contest begins September 2nd. For those of you who didn't participate in this last year, this is a contest where competitors enter programs written in any language which then compete tournament style against each other in a processing intensive task to possibly win money, books, bragging rights, and more. "
Re:"Performance *may* matter." (in the judging!) (Score:1)
--
Perl won't win for performance reasons. (Score:1)
--
Does anyone know... (Score:1)
...what last year's problem was? Just curious as to what to expect.
Steve
Re: (Score:1)
Re:functional langauge (Score:1)
Search engines are your friends, please use them.
Great story (Score:1)
:-)
Cheers,
Ben
Re:stupid hemos on late announcement (Score:1)
BTW, why use an "Anonymous Coward" post and then include your URL? I took a quick look, and you've got a very nice web site. Anybody interested in computational mathematics should have a gander.
Re:Poor Students (Score:1)
If you think you are at a disadvantage, well then, you are, if only because you think you are.
Personnally, I'm going to give it my damndest. I don't know what language I'm going to use yet though.
Perl banned (Score:1)
Re:That obfuscated Perl code contest... (Score:1)
Re:"Performance *may* matter." (in the judging!) (Score:1)
Re:stupid hemos on late announcement (Score:1)
Re:speed or size or what? (Score:1)
Perl is very dynamic, in terms of runtime data storage, execution, etc. Thus, it does well at things that change frequently or are largely undefined at design time.
It makes text/string manipulation very easy. A good deal of what computers do is string processing of some kind.
It uses C-like syntax, and C is very familar to a lot of people already.
It integrates with the POSIX (UNIX) environment very well. Perl is ideal for "gluing" separate, unrelated tools together.
Perl is extremely portable. If you are looking to implement something that will run on as many platforms as possible, Perl is a good choice.
There are a lot of already-written Perl "modules" which are freely available. It is often easier to piece together several Perl modules then to solve a problem from scratch. In particular, there are a lot of web- and database-related modules.
Perl is faster then most interpreted langauges, and there are a number of optimizations which can make it even faster for specific cases (caching compiled Perl scripts in the Apache web server being the popular one).
:-)
:-)
This is not to say Perl is the perfect language. Far from it. The lack of imposed structure and data types is not always a Good Thing. Like anything else, you need to evaluate the available tools, and choose the best one for the task at hand.
As far as learning it does, I think a lot of that is the way it is taught. A lot of books ("Programming Perl" especially) introduce a lot of the Perl "tricks" right away. These "tricks" are useful in contests, one-liners, and write-only code, but for professional projects, they are to be avoided. Again, the lack of imposed structure is not always a Good Thing.
All IMHO, YMMV, etc.
Obfuscated Scheme (Score:1)
Okay, I have to ask, and this isn't a flame, but what do people see in Scheme? Perl was a little obtuse initially, but not a difficult language to learn. Scheme just makes my brain hurt -- the syntax is ++ugly and I just can't seem to wrap my head around it.
Multiple CPUs (Score:1)
hmmm, I wonder if a team of 50 would be too big to effectively manage...
Re:Poor Students (Score:1)
When you do head of to school, you'll probably end up taking a class using a book called "Introduction to Algorithms" written by Cormen, Leiserson an Rivest. Just so you understand where I'm going, Leiserson was on the team ("Cilk Pousse") that won the contest last year.
I'd say that you're not the only one with a disadvantage
-NooM
Re:Language statistics (Score:1)
It's probably still better this way since it gives a good idea of where optimizing functional compilers stand against "the competition." Although the Cilk team one, that second place spot held by a team which used OCaml is a pretty strong statement for the progress of recent compilers for functional languages.
If other languages were not allowed, someone could easily say "well, I could have written something far better in C." Considering that an OCaml entry beat out all entries written in "pure C", and was only second to a multithreaded version of the language, the outcome is more relevant.
-NooM
Re:speed or size or what? (Score:1)
Yes... it's also the Pathologically Eclectic Rubbish Lister, now you know why SlashDot is written in Perl
Re:speed or size or what? (Score:1)
-Jon Schaab
Re:Obfuscated Scheme (Score:1)
-Jon Schaab
Re:pre-written code? (Score:1)
For this year's contest, we have again tried our best to come up with a problem that won't give some teams a competitive advantage over others.
Hopefully everyone will be equally challenged
Poor Students (Score:1)
Contest... (Score:1)
i look forward to getting totally thromped at the hands of some actually competant coders, but eh, whachagonnado
tchort
Embarrasing Code (Score:1)
Re:That obfuscated Perl code contest... (Score:1)
The impression that Perl produces worse code than other languages usually comes from the hurdle of being able to visually guage regular expressions and grasp context-sensitivity. I try to code with these two hurdles in mind (both for abuse in contests and for maintainability at work), and things work out quite well. But, I've learned to think in Perl, so even "bad" Perl is more readable to me than "good" C++ (which I program in, but do not yet think in).
My favorite obfuscated contest entry is still my C/LISP combo which printed "Hello, world" with only one copy of the string in the code. It would run under EMACS LISP or compile as C code. Fun stuff, that!
basic (Score:1)
-Lx?
coolness (Score:1)
Indeed... I agree. If only I could program, heck, I'd enter the thing!
All I can say is, "Carry on! Carry on!"
Language statistics (Score:1)
>Here are some broad statistics for the primary language used by the various teams:
> 24 C dialects: C, C++, Cilk
> 12 ML variants (SML/NJ, Moscow ML, OCaml, >OLabel)
> 3 Scheme
> 3 Haskell
> 3 Perl
> 1 J
> 1 Mercury
> 1 Icon
looks like there was barely enough perl representation to give it a good chance. but doesnt that also say something about it? perl really isnt designed for tasks like this.
im sure ill be using c, but if i get to the last 2 hours and dont have anythign to submit yet, then ill just write a simple little perl script to get the job done.
also, apparently there were only 48 entries last year. maybe getting some exposure here on
Re:functional langauge (Score:1)
while it is obvious that this speeds up development time, does it really improve execution speed over a well written algorithm? it seems to me that maybe one line of haskell code might be able to do what 10 lines of C code can (maybe even in a loop or recursively), but in order to get the job done, isnt the haskell gonna have to do just as much underneath?
also, (and please flame me if im wrong) but dont i remember being told in a programming class that 1.) anything that can be done recursively can be done iteratively, and 2.) that recursion (while often easier to code) is usually not the most efficent solution. ? im still very confused. can anyone help me on why/how functional programs would be faster? (or maybe im misinterpreting the idea of why they were suggested to be used in this contest)
dont think that im trying to put functional programming down, im still learning what it is. i just want to understand more, and i find these
Re:functional langauge (Score:1)
"Functional" programming looks like a subset of object-oriented programming, in which the only objects are functions...what use is that? I can't help but thinking that this is shooting yourself in the foot. If we banished all circular objects from the RL world, it probably would lead to very interesting solutions and phenomenon, but
Re:speed or size or what? (Score:1)
I'd imagine it's good for exactly what it is used for...text manipulation, database/network interaction, data extraction, etc.
Re:functional langauge (Score:1)
Mathematically, a function takes an input and maps it to an output -- given the same input, it will always give the same output. There is no hidden state: the black box always works the same way. Things like random number generators (which produce a different result each time called) aren't true functions.
Functional programming takes that idea and uses it to program. Usually, there is no "state" at all, enforced by the lack of assignment. Variable binding usually takes place through "let" constructs (as in "let x=... in (expression)") or through function calls.
Since iteration tends to be though of as inherently stateful, functional programming tends to lack it -- everything is done using recursion.
So if you use C without using assignment or loops, you can write C in a functional style. An example might be:
int strcmp(char *a, char *b)
/* returns 0 if string a is lexigraphically greater
* than b
*/
{
if ((*a == 0) && (*b == 0)) return 0;
else return *a - *b || strcmp(a+1,b+1);
}
Since this is unnatural for C, functional programming languages have been written to support the programming paradigm. Examples include ML, Haskel, and Lisp. Purists can argue about how functional they are, but compared to C, they are.
Functional programming languages tend to be rich in the ability to arbitrarily construct complex types as needed, and treat functions as first-class objects (you can create them on the fly, pass them as arguments, put them in lists, tuples, records, or other structured types).
This freedom to use functions leads to some very different programming techniques. For instance, one common construct is called a "curry" (after the mathematician who described it), which converts a function of N variables into a function of N-1 variables. For instance, if f(x,y) is a function, and g=curry(f,Y), then g(x)=g(x,Y)). One way of thinking of this is that if you think of f as a two-dimensional array, then curry(f,Y) is a one-dimensional slice of the array.
Or, you could do something like this:
(define (addXto x) (curry add x)) ==> addXto
(define g (addXto 5)) ==> g
(g 4) ==> 9
(g 45) ==> 50
These examples of currying are simple, but it can be a powerful technique.
This is nice (Score:1)
Re:functional langauge (Score:1)
This does not work at all when you want
a function to return a partially applied
function.
The problem with your "encoding" is that it
is possible to create only a fixed (at compile
time) number of partial applications. Whereas
you may want to partially apply g to an unbound
number of values.
But functionnal languages *can* be encoded in
"non-functionnal" ones. You just have a
hard time handling environments by yourself
when you do so.
Re:functional langauge (Score:1)
Functional languages have an advantage in correctness: Its my experience that they're easier to prove correct. I don't know if a haskell algorithm is faster than the c++ one, its probably all in the compiler, and most of the ML compilers I've worked with seem quite a bit younger than c compilers, so they probably haven't been tweeked as much, and consequently, they're not necessarily faster. (But if you think speed is everything, than you're missing the point, I guess)...
I think the reason they're in the contest is because its sponsored by a functional programming group (ICFP).
I don't imagine there's much difference in speed in a good tail recursive function versus iterative.
Someone told me (right before I took a class in ML) that if your ML program compiled, and you knew a little of what you were doing, it was going to be right. Forget all the bug testing and memory leaks, not an issue. Well, I failed that class... but anyway, I still like functional programming, and recursion and induction seem pretty cool.
Re:basic (Score:1)
I was expecting to use punched cards. What is this new-fangled "basic" of which you speak?
speed or size or what? (Score:1)
are they going for speed? size?
if they are going for speed, it is certain that
perl wont win- its interpreted fergodsake...
or for size...
so why do people use perl anyway?
its certainly not an EASY language
to learn...
so all you perl fanatics, whats it good
for?
Re:Language statistics (Score:1)
javascript (Score:1)
Re:That obfuscated Perl code contest... (Score:2)
Yeah, I know... it's possible to write good Perl... it's way too easy to write bad Perl, though. You should see the mess I inherited at work...
Re:pre-written code? (Score:2)
However, it seems the contest ran quite well, so I'll stop complaining =) Good luck on this year's.
pre-written code? (Score:2)
Re:Poor Students (Score:2)
Re:"Performance *may* matter." (in the judging!) (Score:2)
"Performance *may* matter." (in the judging!) (Score:2)