8th Annual ICFP Contest
mauricec writes "Think your favorite programming language is the best one out there? Put it to the test in this year's International Conference on Functional Programming's annual Programming Contest. The contest is coming up in a little under 4 weeks! This year's competition rewards programmers who can plan ahead. As before, we'll announce a problem and give you three days to solve it. Two weeks later, we'll announce a change to the problem specification and give you one day to adapt your program to the new spec. More info on the contest and prizes is on the contest's web page."
If the original program can be written in 3 days, chances are a good programmer can write a new one that matches the changed specifications from scratch in one day. Is this cheating? :-P
Prediction: more people in this thread will make that mistake.
If the cat can't experience its own death, nothing will ever kill you. (No, really!)
We actually did just this as an assignmet in a software engineering class a while back. We had to write a simple life simulator, and then a new assignmet was handed out that changed the original specifications.
The last part of the assignment was to make our life-forms compatible with that of at least one other group. This last part proved quite interesting as, even though the critters were technically compatible with the other groups environment, many of the assumptions our two groups had made about the world (such as sight radius of each creature, how much food a creature needs, how fine grained the world was...) made the creatyres behave rather weird.
Still, it is a good way to be forced to write code that is easy to refactor from start!
Hmm. Two weeks to complete a project, followed by a changed spec the day before going live.
sounds like some of my clients.
This is just like in real life. Design a program to spec, and then 1 day before launch, change the requirements. Is this the kind of activity we should really be promoting? Maybe we should give well laid out requirements, and whoever follows them the best, wins. Not only would following the requirements be important, but also not exceeding the requirements, and adding a bunch of stuff that wasn't asked for, would cause you to lose points.
Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
There are some comments already saying "if the program could be written in three days, couldn't they write a new one from scratch in one day?" The answer is that a very fast programmer probably could. But what would the point be? The object of this exercise is to show off just how generic a program written in a functional language can be. It really is possible to abstract everything, leading perhaps to the famous paradox "Everything can be solved by adding another layer of abstraction, except having too many layers of abstraction."
Putting that aside, I think this is a great idea for a competition. I hadn't heard of it before this one, and have only recently got into functional programming myself. I'm a new-found convert to ML, and find it interesting to be forced to think about a problem in a completely new, and usually recursive, way. ML also has some imperative elements but I prefer to avoid them as far as possible. I'll attempt to make an entry to this contest, although I doubt I'm at the relevant level of expertise yet.
I'd be interested to hear what languages other Slashdotters think would be most appropriate to a contest like this. Lisp gurus, start your engines!
apterous.org
No, but (from your link) it does "change its structure and design, and remove dead code, to make it easier for human maintenance in the future."
Refactoring might be a sensible thing to do during the two weeks between the first and second phases of the competition.
Having said that, from my (limited) experience, you tend to need less refactoring in functional programming languages than in imperative (or object-oriented) languages.
Matt
...is that you have to write a program to kill Microsoft
GETPKG - Package Management for Slackware
Refactoring does not change behavior.
That is right, but often when you get changed requirements, or when you have to add functionality while keeping the old behaviour, first thing you do is refactor. With the new requirements in mind you can see where your design should be more generic. By refactoring to accomplish this, you make it easier to build the new functionality on top of the existing code.
In my (short) experience, I've found that planning ahead is, most of the time, a bad idea.
It takes time. It makes the code more complex than it could be, and thus less readable and maintainable. And when the spec finally changes, it changes in a way that makes this additional layer of complexity useless, and another layer is added on top of it.
Correction: Refactoring should not change behavior
I enjoyed programming in Lisp, but it fell out of favor. Now I have to use Javasp.
Yes, because if refactoring does change behaviour, you must have introduced a bug. And code should not contain bugs.
Try out fish, the friendly interactive shell.
This is often true because functional languages are not very abstract. They tend to be very mathematic and algorithmically driven.
Object Oriented design requires one to think in a way more human, and less mathematic/computerish. We classify things as "objects", we give objects "methods" and "properties". Functional languages only have properties (coeffecients and inputs, etc).
Refactoring OO programs tends to be a hobby, more than a necessity, as I find it. Every now and again you'll hit something that greatly speeds up the code, but more likely it just makes the code either look better, or more usable if you were to plug it into something else, neither of which I end up doing very much.
"Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is." G.W.Bush
grr, should use the preview button;
..code WORK better or more usable.. neither of which ends up very useful to me...sigh.
"Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is." G.W.Bush
Can I write my program in C and look whether or not I'll be able to adapt it just as quickly?
Assorted stuff I do sometimes: Lemuria.org
"Hey, significant other, I'm not into it for the money"
Worked for me. YMMV.
Mod parent down. If you read his other posts, you will see that he is confusing functional languages (ML, Haskell, Scheme) with procedural languages (C and Pascal). Unlike procedural languages, functional languages, with roots in the lambda calculus, are very abstract to the degree that people often complain they are too abstract to be useful.
The parent poster makes the same mistake in nearly all of his posts under this article. Watch out.
Don't know who's from Toyota, but Microsoft has some very research oriented people on their payroll: Simon Peyton Jones (big time Haskell guy), Cedric Fournet (the creator of JoCaml), Don Syme (working on f# -- a variant of OCaml for .NET), and so on), and I'm guessing the US Military Academy representative is Chris Okasaki, author of Purely Functional Data Structures. BTW, you do know that the Military Academies are universities, don't you?
-30-
I'm halfway tempted to enter this contest - using COBOL. Just to show that it can be done.
MS
"Lisp gurus, start your engines!" -- NOT!
I think Forth.
Small core, fast, functional, modular, & universal.
It's not surprising that you've got big entities who also have academic divisions. The schism between academia and the commercial world isn't nearly as big as its made out to be, though it is bigger in computer science than in other engineering fields. This is especially true of very large or very small companies, both of which see a particular benefit in utilizing the advancements of academia. The former, because they are so big that they can only grow through innovation, and the latter because they are so small they can only survive through innovation.
A deep unwavering belief is a sure sign you're missing something...
Nah, thats too harsh. After all, if you worked for EA a chance at $7.29 an hour would be an EXCELLENT reason to jump ship.
Help poke pirates in the eyepatch, arr.