Slashdot Mirror


ICFP 2001 Task

David Mentré writes: "The ICFP 2001 programming contest TASK is now available. The objective is to write an optimizer (aka compressor) for an HTML-like language. It must work for arbitrarily big inputs and in a limited wall-clock time. Can you guess what will be the winning language? ;)" We already announced the contest, but now that the task is available, it might be fun to look at. So what will the contestants come up with? Anyone think perl might be the language of choice? :)

110 comments

  1. Caution!!! by Anonymous Coward · · Score: 1

    For those who are actually participating the competition, SAVE THE DOCUMENT!!! Don't give yourself an excuse for LOSING when the page is SLASHDOTTED and you can't lookup the task again!!!!!

  2. My favorite language is by Anonymous Coward · · Score: 1

    C

    Now what was the article about ?

  3. Its almost certain by Anonymous Coward · · Score: 1

    the winning entry will be written in Intercal :)

  4. Re:What about XML/XSL? by Anonymous Coward · · Score: 1

    That would be historical. Never before has a markup language challenged the dominance of a programming language.

  5. Re:no ++ by Anonymous Coward · · Score: 1

    > ie, it doesn't have to be a functional programming language.

    Of course. Go ahead, and ridiculize yourself by submitting an non-functional entry.

    Those guy are functional from the bottom up, and their preaching about it. The contest is _designed_ to make non-functional languages ridiculized.

    I bet that the SML/NG input to the software will be tailored to make functional software win (ie: you will have incredibely complex input, that will only be suitable for languages with built-in matching, so functional languages will be standing on the shoulders og giants).

    Using C or C++ in this constest is akin using perl to write a linux kernel module.

    Note that it is not a bad contest, on the contrary. It shows the areas where functional languages shine. Of course, I'll be rotfmalo the day where someone will submit a winning C entry (for instance, by having a library that would implement most of the goodies functional languages are good at)

    Cheers,

    --fred

  6. Re:this story is gay by Anonymous Coward · · Score: 1

    not that there's anything wrong with that.

  7. Re:no ++ by Anonymous Coward · · Score: 1

    Parsing is easy. Very easy. The problem is finding possible optimisation transformation on the parsed form.

    I am really short of time, but I am pretty sure that there are case where an optimisation will depend on very distant tags. This is the place where you C program will have a very hard time (in particular because the time limit imposes non-brute force heuristics).

    That beeing said, 3 days is a lot of time, and the contest *looks* easier than the preceeding ones.

    Cheers,

    --fred

  8. Re:And the winner is... by Anonymous Coward · · Score: 1

    Java 1.4 has regex pattern matching in the standard libraries.

  9. Re:no ++ by Anonymous Coward · · Score: 2

    Slashdot editors suck, and that's the story i'm sticking to!

  10. Re:Oh, OK. Sometimes I'm just really stupid. by KingKurly · · Score: 1

    ...I must admit, I've never seen someone post a reply to a reply to their own message.

    --
    It was recently discovered that research causes cancer in rats.
  11. Re:Oh, OK. Sometimes I'm just really stupid. by mprinkey · · Score: 1

    I see what I'm missing. Color nesting makes it hard.

    Hint: There are also EM/S nesting, size nesting, and underline nesting optimizations.

    Local optimizations can be done on the fly as you initially indicated. The global optimization problems for nesting are algorithmically "hard." My guess is it is NP. The global optimization problem can be stated as a path minimization problem in a fairly large state space (naive size is 2x2x2x2x2x4x10x8) with ordered waypoints. The state space is actually a bit smaller than that.

    Oh, and the state transition distances are different. A <B>,</B> pair costs 7 bytes, but a <PL>,</PL> pair costs 9. I bet that linear programming will choke on this problem too. There are a bunch of local minima. Time to dust off my Numerical Recipes book and read up on simulated annealing.

    Of course, what do I know?

  12. Re:Doesn't sound too hard... by mprinkey · · Score: 1

    First pass optimizations should be able to guard against stupidity. My first cut just clears out whitespace and trivial redundancies, like:

    <B></B>This is not Bold<B></B>

    or

    <B><B>This was already Bold</B></B>

    The first pass optimization will worst case include all of the original tags and should therefore pass the stupidity test. Of course, after this initial cleanup, then the real work has to start.

  13. Purely functional C by iabervon · · Score: 2

    We don't need = (except in initializers, of course)...

    Hmm... I have better things to do than figuring out an algorithm for this, really I do...

  14. What about XML/XSL? by bpdlr · · Score: 2
    Sorry to upset the apple-cart, but might a combination of XML and XSL challenge the dominance of Perl? I'm afraid I am not suffinciently advanced in these languages to bet on them, but I reckon they would give the other contenders a run for their money.

    --
    Barry de la Rosa,
    public[at]bpdlr.org

    --

    --
    Barry de la Rosa,
    public[at]bpdlr.org
    My /. ID is lower than Bruce Perens'!

    1. Re:What about XML/XSL? by Simon+Brooke · · Score: 3
      Sorry to upset the apple-cart, but might a combination of XML and XSL challenge the dominance of Perl? I'm afraid I am not suffinciently advanced in these languages to bet on them, but I reckon they would give the other contenders a run for their money.

      No.

      XML is not a programming language, it's a markup language. You can't use it to compute anything. XSL-FO is not a programming language, it's a page description language. You can't use it to compute anything. XSL-T is a programming language, and a very elegant one, but it isn't (IMHO) well suited to this task, and certainly would not produce a compact output.

      --
      I'm old enough to remember when discussions on Slashdot were well informed.
  15. Re:Who will win? Look at past years: by petrov · · Score: 1

    the corrolary to this is that O'Caml is only used by grad students who have tons of free time, while C/C++ is used by people who get paid.

    --sam
    --sam

    --
    --sam
    Any technology distinguishable from magic is insufficiently advanced.
  16. Mercury faster than C? by Fergus+Henderson · · Score: 1
    Lots of tests aren't implemented for Mercury, which explains its low score.. but it isn't doing to well in the ones that are implemented, anyway.

    Doug forgot to enable the Mercury compiler's optimizations! He's fixed that now, so we now do a lot better than before.

    Nonetheless, I think the Mercury folks took a prize last year though, didn't they?

    We came fourth, which was good enough to rate a mention, but not good enough for a prize.

  17. I think ANSI Pascal's up to the challenge. by Requiem · · Score: 1

    Who's with me?

  18. Re:Guess What ? by CelestialWizard · · Score: 1

    Or in Objective Oberon with an object orientated design, or perl, or c, or c++, or shell with awk and sed.
    i suppose if you are a real glutton you could use assembler *shakes head*

    actually a language with excellent string manipulation is also Business Basic (Basis Business Basic or ProvideX Basic)

    pick your favorite language
    \\||//
    --ooo00ooo--

  19. Re:If you need me... by ethereal · · Score: 1

    [Dilbert] Not so good, you just authored IIS.

    Remember: it's a "Microsoft virus", not an "email virus",

    --

    Your right to not believe: Americans United for Separation of Church and

  20. Re:excuse me... by mcc · · Score: 1

    Actually, perl is a fully functional language in a pure sense; functions are values, and the language features anonymous functions and closures. Arguments are passed as a list, meaning you can curry if you feel like it.

    You just very rarely see perl being used functionally because despite the fact it has functional features, its functional features are really quite clumsy to use, and anyone prone to functional programming would probably prefer another language anyway.. in other words, you can be as functional as you like in perl. It just isn't worth the bother.

    Larry Wall likes LISP, though.

  21. Scheme/Lisp by DGolden · · Score: 3

    Just to point out, there's a good functional XML parser/processor available for Scheme - as everyone here knows, XML is just a verbose way of writing certain Lisp S-Expressions. This software will allow you to load any XML in as a lump of Scheme, and it can then be treated like any other Scheme data structure you've been taught how to process in CS 101. See www.lh.com/~oleg/ftp/Scheme/xml.html

    for example: <WEIGHT unit="pound">
    <NET certified="certified"> 67 </NET>
    <GROSS> 95 </GROSS>
    </WEIGHT>

    becomes:
    (WEIGHT (@ (unit "pound"))
    (NET (@ (certified)) 67)
    (GROSS 95)
    )

    --
    Choice of masters is not freedom.
  22. How about.... by ChrisBennett · · Score: 4

    Java?
    Anyone? Ok, I'm actually serious, don't mod me up +1 Funny.

    1. Re:How about.... by iapetus · · Score: 2

      Why go for third party add-ons? You do know there's support for regular expressions in Java these days?

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
    2. Re:How about.... by leifw · · Score: 1

      Heck, now that's funny!
      I'd give you +2 Funny, were it possible.
      Mind you, that's not because of the Java suggestion; rather it's the mod point filer request that cracks me up.

    3. Re:How about.... by Blackjax · · Score: 1

      Not AS unreasonable as you might think.

      http://alphaworks.ibm.com/tech/regex4j

      Still, this isn't exactly Javas' core competency.

  23. Lex &Yacc by NitsujTPU · · Score: 1

    I'm sure that there will be quite a few hacks out there using lex & yacc & C :-)

  24. I dare you... by Pascal+of+S · · Score: 1

    To do it with a regular expression.

  25. Let's see the code people by exa · · Score: 1

    I'm joining the contest. That is if this damn semantic analyzer works, I can get on to the optimization part. :P

    --
    --exa--
  26. Re:innovation by mmclean · · Score: 1

    No, no, no . . . you got it all wrong. The winner will be in C#

  27. Re:Mercury by AntiFreeze · · Score: 1
    No, because Perl isn't a functional language. *sigh*.
    Read the rules first.

    Check out comment 28, it's his point.

    ---

    --

    ---
    "Of course, that's just my opinion. I could be wrong." --Dennis Miller

  28. Re:Just to torture myself by spudnic · · Score: 1

    #!/bin/bash

    gzip *.html

    --
    load "linux",8,1
  29. Re:Who will win? Look at past years: by NMSpaz · · Score: 1

    Yes, and open source software sucks because if Linus et al had real jobs, they wouldn't have time to futz around in their spare time...

  30. Re:And the winner is... by Pseudonym · · Score: 2

    While that's partly true, it won't help you. The task is designed for functional languages, and it shows. Functional languages have algebraic data types and pattern matching built in. In C you'd have to implement this yourself, plus all the code required for memory management and write the optimiser, all in three days.

    That's why I predict O'Caml will win. Of all the languages which have native support for precisely this kind of task, it's the one that also has the support for beating the time limit.

    --
    sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  31. Re:And the winner is... by Pseudonym · · Score: 2

    Java does not have pattern matching, unless you think method dispatch is pattern matching. :-)

    Having said that, Java would be a good general-purpose language to solve this problem in. I don't like your chances given the three day limit, though.

    --
    sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  32. Re:Any language will do by Pseudonym · · Score: 2
    Anyhow, speed will be the deciding factor on this one.

    No, flexibility will be the deciding factor, closely followed by speed of development. Speed of execution won't make a huge difference, because the judges are going to throw in a test case so large and complex that no program can find the "optimal" sequence in the given wall time on the test machine. So the winner will be the program which can make the best use of the time available.

    The winner will use a set of optimisation techniques (from simple transformations to expanding the string out into decorated characters and re-encoding), and will be able to combine these techniques seamlessly. And this will be coded in three days.

    This is not a test for a systems programming language like C. This is a test for a language in which you can write complex decision logic quickly.

    --
    sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  33. And the winner is... by Pseudonym · · Score: 5

    I predict that the winner will probably be O'Caml, and for one reason only: it will beat the time limit. Moreover, this will have little to do with the speed of the O'Caml implementation.

    Your program has to complete within a given wall time (not CPU time). This is supplied as a command-line argument and environment variable. The winner will be the tool which can stop computing before the time is up and produce the output. The winning program will be one that iteratively improves the input string, but is monitored by another thread which stops the optimiser thread when the time is almost up, then grabs the best solution so far and performs the output.

    O'Caml just happens to have good built-in primitives to write this kind of "interrupt the thread when the time is up and let me know what you did" computation.

    --
    sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    1. Re:And the winner is... by radish · · Score: 1


      Java? Memory management - check; pattern matching - check; threads - check. All there and done for you, just have to write the actual optimiser. I might even give it a go and see how it handles it...

      --

      ---- Den ene knappen er powerknapp, den andre er Bender voice knapp "Bite My Shiny Metal Ass"

    2. Re:And the winner is... by Tom7 · · Score: 1

      Well said, dude.

      I'd like to see a java entry in this, but having written compilers in java before, I know it is very painful. (Not as painful as C, mind you, but painful.) The ML family and related languages have a huge advantage here.

    3. Re:And the winner is... by RevAaron · · Score: 2

      Not to mention that an OCaml team has won the last ICFP contests. Perhaps it's not the language inherently, but the intelligent people who chose it. :)

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    4. Re:And the winner is... by RevAaron · · Score: 2

      My bad. 1998's entry was written in Cilk, a version of C with parallel extensions.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    5. Re:And the winner is... by joto · · Score: 2
      Yes, but regex pattern matching has nothing to do with pattern matching when speaking of (functional) computer languages.

      Instead it refers to a convenient mechanism for building switch-like statements over algebraic datatypes. Since the language in the task is described by a grammar, it can be represented as an algebraic datatype in a functional language.

      In Java-programmer-friendly lingo, this would mean: Make one constructor (differently named) for each element in the grammar. That way you can build a tree from the text you parse. Then you can make recursive functions, either modifying or returning a new tree, where you will typically use switch-statements on the data, differentiating each elemeent by the constructor used to create it.

      Most functional languages are quite convenient when working with data represented in a tree-form, because algebraic datatypes are so extremely convenient. In Java, one would have to use classes and subclasses instead of one simple definition of an algebraic datatype, and lot's of casting and if-statements instead of pattern matching. It's not that it can't be done, it is just a bit more to write (which happens to be somewhat important when having limited time available, but certainly not all-important, if you type fast).

    6. Re:And the winner is... by Sapien__ · · Score: 3

      You can do this easily in other languages too, such as alarm() in C (and Perl too!)

    7. Re:And the winner is... by amanb · · Score: 1

      I think lots of {if time > limit then return} statements would be a better idea than threads. Anyway, better or not, its still easy to do it in any of those jurassic procedural languages. Still, ocaml has good chances of winning coz its a powerful language with a great implementation.

  34. SNOBOL... by PTrumpet · · Score: 1

    ...would be my bet ;)

    1. Re:SNOBOL... by mr_walrus · · Score: 1

      my first thought too...

  35. Re:Who will win? Look at past years: by selectspec · · Score: 4

    Thats because all of the good C engineers have jobs and are too busy to fsck around with stupid games like this. Caml programmers bored from a lack of any employment in the real world had no problem finding the time to dedicate to this problem.

    --

    Someone you trust is one of us.

  36. Re:Hesitating ? by Steeltoe · · Score: 1

    No INTERCAL beers? That one could be interesting :-)

    - Steeltoe

  37. Solution in /bin/sh by bero-rh · · Score: 1

    echo Server: Microsoft IIS/5.0
    echo Content-Type: text/html
    echo
    echo <html><title>Server overloaded</title>
    echo <body bgcolor="#0000FF">
    echo <font face="Courier, Courier New, Fixed">
    echo IIS.EXE caused a general protection fault in
    echo module BLUESCREEN.DLL at 0123:45F00F00
    # Yes, I know it's not exactly clean HTML
    # It'll work in almost all browsers though, and
    # they DID say compressed...

    --
    This message is provided under the terms outlined at http://www.bero.org/terms.html
  38. Re:This is easy... by bero-rh · · Score: 2

    Since most can handle it, you may even want to "compress" head and body statements... And, of course, leave out closing tags.

    print "404 Not FoundThe requested URL was not found on this server.";

    --
    This message is provided under the terms outlined at http://www.bero.org/terms.html
  39. Any language will do by Jeppe+Salvesen · · Score: 2

    At least for correctness. Think about it..

    All you have to do, is parse the document, and then spew it back out in a smaller representation. There are lots of booleans in there, and those are as far as i can see what you really need to worry about.

    Of course, I'm not gonna bother to do this one...

    Anyhow, speed will be the deciding factor on this one. I wouldn't be surprised if the winner is written in plain ole C.

    --

    Stop the brainwash

    1. Re:Any language will do by stilwebm · · Score: 3

      Anyhow, speed will be the deciding factor on this one.

      I'll be pretty surprised if speed ends up being the deciding factor, at least for the first few places. This is a pretty complex problems with many ways you can optimize certain aspects, like overlap inversion, color nestsing, redundency elimination, etc. But to really minimize the size of the output file (the most important factor after qualification and validity) contestants have to come up with a great balance of optimizing all of those factors together. Because it of time constraints, contestants cannot effectively run multiple attempts across all optimizations to find the single smallest output (this would run in exponential time, so small inputs might work, but large ones would run for days). The winners will likely have the best algorithms for optimizing the output in some kind of polynomial time, regardless of the language used.

    2. Re:Any language will do by lastberserker · · Score: 1

      The true yet hidden reason behind the scene is to get postprocessor M$ Word HTML output for free. Those guys from M$ learn fast, you know ;-)

      --
      My other Beowulf cluster is... er...
  40. Re:SML/NG by Tom7 · · Score: 1

    Yeah, it's those french guys and their secret war of Caml vs SML. =)

  41. Re:Who will win? Look at past years: by Tom7 · · Score: 1

    You mean, they are too busy debugging their core dumps and memory leaks? ;)

  42. Re:actually... by Tom7 · · Score: 1

    C is a poor language for rapid development because it is not safe -- it's too easy to have a space leak or a myserious crashing bug. Manipulating strings and data structures in C is also rather tedious.

    I would expect that a good C implementation would not be faster, either, because using a higher-level, safe language would allow you to make more optimizations to your program (since you can write it faster).

    Go ahead and prove me wrong, though!

  43. Re:Guess What ? by Tom7 · · Score: 1

    > or perl, or c, or c++, or shell with awk and sed.

    Ha, good luck with those. This is not just simple string manipulation...

  44. Well, Microsoft Research. by Tom7 · · Score: 1


    Well, that would be Microsoft Research, actually, and last I checked Peyton-Jones was at the Cambridge one.

  45. Mercury Speed by Tom7 · · Score: 1


    Here's benchmarks:

    http://www.bagley.org/~doug/shootout/craps.shtml

    Lots of tests aren't implemented for Mercury, which explains its low score.. but it isn't doing to well in the ones that are implemented, anyway.

    Nonetheless, I think the Mercury folks took a prize last year though, didn't they? (Don't get me wrong, I'm all for unorthodox new languages.)

  46. Re:LISP by Tom7 · · Score: 2


    I don't think lisp is the most popular functional language any more.. I would say it's probably SML or O'Caml. Lisp hasn't won in any of the previous years, I don't think.

    I agree wholeheartedly, though, that Perl won't be powerful enough for this kind of AST manipulation. I like that the task will probably make slashdot kids think that perl is extremely appropriate -- that will put them in their place all right. ;) Bring it on!

  47. Brainf*ck. by Lussarn · · Score: 2

    I am positive Brainf*ck will be on the podium.

  48. I doubt it... by Carnage4Life · · Score: 2

    I'm afraid I am not suffinciently advanced in these languages to bet on them, but I reckon they would give the other contenders a run for their money.

    XSLT is designed not to have side effects and is instead more of a functional language meaning that you can't assign values to variables dynamically. Considering that this task may require quite a lot of storing of state before deciding which optimization to make I think it is rather unlikely that XSLT is a good language to use to solve this particular problem.

    Then again I didn't look too hard at the task but it may be that the judges have designed it in such a way that it is amenable to functional programming considering that it is the being run by the International Conference on Functional Programming. Even then most functional languages do allow you to store state, even Lisp so an XSLT solution would have to be rather clever.

    --

  49. Re:Doesn't sound too hard... by Mr.+Sketch · · Score: 3

    You're missing the fact that the tags have to be paired. Ensuring the tags are paired isn't a problem, but ensuring the tags are paired optimally is where the difficulty arises.

    Consider: <B><I>Hello</I></B>World&l t;B><I>Foo</I></B>
    Should be: <B><I>Hello<PL>World</PL>F oo</I></B>
    But how do you know if it's more optimal to go with a PL tag vs closing the B and I? You would need the array to go further down and see that you will need the B and I again so you don't bother to close it.

    This is the problem I'm running in to now :). I'm writing my entry in Haskell and I have a fairly decent optimizer except for these cases and it's currently a 110 line Haskell program.


    --BEGIN SIG BLOCK--
    I'd rather be trolling for goatse.cx.

  50. Re:no ++ by Stochi · · Score: 1

    wouldn't it be possible to use lex/flex to generate a C scanner that could parse the data just as easily as perl? C by itself may not be the answer, but there are some tools that use C that can make life a lot easier.

  51. If you need me... by Nastard · · Score: 5

    If you need me, I'll be doing a preliminary victory dance over in the QBASIC camp...

    1. Re:If you need me... by denshi · · Score: 1

      Would that be anything like a little rat dance on a keyboard??

  52. Re:Where's the torture? Scheme is fun! by RevAaron · · Score: 2

    A helluva lot simpler. One form- (function-name param1 param2... paramN). Not a whole bucket of syntax rules like you find in those BCPL derived languages. Oh well, let the children speak their C, C++, and Java and leave the meat to the parents.

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  53. Re:Where's the torture? Scheme is fun! by RevAaron · · Score: 2

    Perhaps. But C++ never was very usable for a big project to me either. So much work for so little result. Smalltalk has worked for me, but to each his own I supose.

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  54. 72 hours, No Sleep Till Brooklyn! by poetic+justice · · Score: 1
    I've got to go to work today, here's a cool contest, maybe I should call in sick? Work all day today and tonight.
    1. Check Coffee Supply
    2. Check Mountain Dew Supply
    3. Damn..Users calling already!
    4. Join Mailing List, wait for next year.
  55. Re:Mercury (Perl has first-class functions) by Atom+Tan · · Score: 1
    No, because Perl isn't a functional language. *sigh*.

    No, Perl has too many capabilities to be considered a purely functional language, however it does have first-class functions, so any program that can be created in more than one functional language (say Lisp and ML) can also be created in Perl:

    http://perl.plover.com/lambda/

  56. Re:no ++ by Sapien__ · · Score: 5
    Umm... from the website:

    This programming contest is being conducted by ICFP, which implies a context of functional programming. However, rather than debate the definition of a "functional programming language," we will allow submitted programs to be written in any language whatsoever, as long as it has an implementation for Pentium PCs running Linux. Mixing languages is entirely acceptable; perhaps you will write in Caml and Haskell, with a Tcl script to do the gluing.

    ie, it doesn't have to be a functional programming language.

  57. ...the awesome power... by jeko · · Score: 2

    Logo! Logo! Bow before the awesome power of the turtle!

    --
    He put his boots up on the table and made a face. "The sig," he smirked. "You can waste your life in search of the sig."
  58. Mercury by cthugha · · Score: 3

    As far as time limits are concerned, may I suggest Mercury. It's a functional/logical hybrid that's somewhat unorthodox for VHLLs in that it's a compile-only rather than interpreted-only or interpreted/compiled. Its designers claim that it can get similar performances to programs of similar functionality written in C, alhtough I haven't seen any benching, and I'll believe it when I see it. :)

    Anyone think perl might be the language of choice? :)

    No, because Perl isn't a functional language. *sigh*.

  59. And if M$ doesn't win... by mizhi · · Score: 1

    They'll simply buy out the winning team and divvy them up.

    --
    Humorless sig goes here.
  60. Arbitrarily Large Inputs by po8 · · Score: 2

    Actually, they say they will test with inputs as large as ``a few megabytes''. Note that it is always legal to merely echo an input if you can't figure out how to optimize it...

    Regardless of how we do in the competition, we're learning a lot about our programming language and its implementation, anyhow. The task isn't a perfect fit for our language, which is good, since it has tickled some of the dark corners already.

    Two days to go!

  61. Re:Mercury (Perl has first-class functions) by sv0f · · Score: 2
    No, Perl has too many capabilities to be considered a purely functional language, however it does have first-class functions, so any program that can be created in more than one functional language (say Lisp and ML) can also be created in Perl

    Lisp is not just a functional language, as any functional purist will tell you with an air of disdain. It supports multiple paradigms.

    I don't know Perl, so the following is a real question, not merely rhetorical: Can you create new functions on the fly in Perl as you can in Lisp? That is, can you have a function1 that returns a new function2 as its value, where function2's definition is relative to the parameters that were passed into function1 at its time of creation? That is, can you create closures in Perl? In Lisp, this is done as follows:
    ? (defun make-adder (addend1) (lambda (addend2) (+ addend1 addend2)))
    => MAKE-ADDER
    ? (make-adder 3)
    => #{COMPILED-LEXICAL-CLOSURE #x1487FBE}
    ? (funcall (make-adder 3) 2)
    => 5
    Just passigning functions around does not make a language functional. Heck, C can do this function pointer. Truly functional languages support the creation of closures (among other things). Can Perl do this?
  62. Re:actually... by sv0f · · Score: 2

    why would C be inferior for solving this task?

    It's a great choice. You'll kill the guys working in x86 assembler.

  63. Hesitating ? by mirko · · Score: 1

    Just choose your favorite language amongst the ones used in the "99 Bottles of Beer on the Wall" gallery.
    I'll personally offer 99 bottles of Chimay Belgian beer to the winner of he does it in BrainF***!
    --

    --
    Trolling using another account since 2005.
    1. Re:Hesitating ? by Smedrick · · Score: 1

      I'll personally offer 99 bottles of Chimay Belgian beer to the winner of he does it in BrainF***

      I think I'd need those beers before coding.

      --

      --
      "I strongly urge both the faint of heart and the faint of butt to leave the room at this time."
      - Strong Bad
  64. Guess What ? by mirko · · Score: 2

    I'd like to create a Forth Team as I consider this rather ignored language as one of the most elegant solutions in terms of language simplicity as well as interpreter efficiency.
    --

    --
    Trolling using another account since 2005.
  65. SML/NG by Godwin+O'Hitler · · Score: 3

    Did anyone else spot the similarity between the name of their mark-up language and another language?

    --
    No, your children are not the special ones. Nor are your pets.
    1. Re:SML/NG by neorf · · Score: 2
      when i first read SML/NG i actually read "smiling"

      maybe you know something i don't.


      ---

      --


      ---
      Never send a man where you can send a bullet.
  66. Where's the torture? Scheme is fun! by brlewis · · Score: 2

    It takes a little up-front learning if you're used to, say, C. The syntax is different from other languages, but actually simpler.

  67. MSFT took 2nd in 1999 with Haskell entry by brlewis · · Score: 2

    MSFT was among the 1999 winners, but their entry was in Haskell, not Visual Basic. Unfortunately their writeup has disappeared from the MSFT web site.

    1. Re:MSFT took 2nd in 1999 with Haskell entry by janpod66 · · Score: 2

      It's nice to see that Microsoft supports some more advanced and academice computer science, after two decades of making fun of companies that did. I think most of the work on Haskell happened before the people involved got hired by Microsoft, so this isn't a sign yet of "Microsoft innovation" yet. But, there is hope.

  68. Large projects necessitate bad code? by brlewis · · Score: 2

    Hint: 20 levels of bracing means you should be breaking that function down into smaller, reusable functions. You don't tend to do that in C++ because it's such a drag -- cut, paste, declare, etc. In Scheme new functions are cheap and easy.

    That aside, who says you have to use it for a large project before it's fun? I'm having fun with a couple of 3KLOC projects.

  69. Who will win? Look at past years: by brlewis · · Score: 5
    2000
    1. PLClub submitted two separate entries using OCaml, either of which would have won the contest.
    2. Camls 'R Us took second place.
    3. Galois Connections took third with their Haskell entry.
    4. The Merry Mercurians took fourth with their Mercury entry.
    1999:
    1. Camls 'R Us mopped up the competition with their 3585-line OCaml entry
    2. The 1250-line Haskell Entry that took 2nd place was written in a mere 24 hours.
    1998:
    1. First prize was a Cilk entry. Winning the contest doesn't seem to have made the language take off in popularity.
    2. Second prize: an OCaml entry ``beat out 23 C and C++ entries, many of these being highly tuned programs produced by extremely competent programmers skilled in game-playing algorithms.''
  70. I would like by oznet · · Score: 1

    for it to be Ruby, but I imagine some type of Lisp-like language would be best. Maybe Scheme as others have mentioned.

  71. My money's on Apple's Integer Basic by tmark · · Score: 2

    Everyone knows that Integer Basic had much better performance than Applesoft, as long as you can tolerate only having integers. 10 COLOR=3 20 PLOT 10,10 umm, what else was the program supposed to do ?

  72. Irritating Superfluous Parentheses by sourcehunter · · Score: 1

    Don't let all the Irritating Parentheses fool you, LISP WILL WIN!

    --

    quis custodiet ipsos custodes - Juvenal
  73. JOVIAL!!! by dbretton · · Score: 1

    Pick me, pick me!
    JOVIAL will kick some serious buttocks! :)

    -D

  74. innovation by rfsayre · · Score: 3

    Thanks to relentless innovation from Redmond, the choice is clear. A team working in Visual Basic will clearly triumph.

    Art At Home

  75. LISP by Proud+Geek · · Score: 2

    Perl hasn't a chance. As much as we all love it, it is not up to the task of writing complex programs such as this. The winner will probably be written in LISP, because it is the most popular functional language. The only other possible winners are better functional languages such as Caml or Haskell.

    --

    Even Slashdot wants to hide some things

    1. Re:LISP by seanadams.com · · Score: 1


      BS. You can write anything in perl.

      ---

  76. The dark horse by Smegma4U · · Score: 1

    I think the winner could quite well be SNOBOL.

    It sure would be nice to hear some positive news about SNOBOLing

    I know, bad joke :-)

    --
    If it's supposed to move and doesn't, use WD-40. If it moves and it shouldn't, use duct tape.
  77. Re:this story is gay by Patrick+May · · Score: 5

    You mean this story is thin, neat, and dresses well?

  78. Re:Mercury (Perl has first-class functions) by hding · · Score: 2

    Perl does in fact have proper closures. E.g.

    #!/usr/bin/perl -w
    use strict;

    sub make_adder {
    my $addend = shift;
    sub {my $x = shift; $x + $addend}}

    my $adder = make_adder(3);
    print &$adder(2), "\n";

    IMHO not as nice as Lisp or ML, but there nonetheless.

  79. nevermind all that... by fearboy · · Score: 1

    i got it!

    10 print "please have a cup of coffee"
    20 compress data
    30 goto 10

    done!

    --
    every good .sig i have is stolen.
  80. Just to torture myself by strictnein · · Score: 3

    I think I'll use Scheme

    1. Re:Just to torture myself by SilentChris · · Score: 3
      I might try to hack it in assembler on my TI-99/4A. :)

      By the way, what exactly do we win if we have the best entry?

  81. actually... by sydneyfong · · Score: 1

    why would C be inferior for solving this task?

    --
    Don't quote me on this.
  82. Python Team by crealf · · Score: 4
    A Python team is trying to solve the task:

    Everyone is welcome.

  83. This is easy... by gnovos · · Score: 3

    print "
    <HTML>
    <HEAD>
    <TITLE>404 Not Found</TITLE>
    </HEAD>
    <BODY>
    <H1>Not Found</H1>
    The requested URL was not found on this server.
    </BODY>
    </HTML>";

    --
    "Your superior intellect is no match for our puny weapons!"
  84. Lightning entry by antientropic · · Score: 2

    I think I will just submit cat(1). Should beat all others in the "correctness" and "speed of optimisation" department!

  85. Re:Doesn't sound too hard... by Ziwdam · · Score: 1

    Hmm... actually you wouldn't need to make an array at all. My brain really isn't functioning. You could do it on the fly. Hmm... but there's a plain tag... that could make it harder... I think I'm missing something. ;-)

    --
    It is a miracle that curiosity survives formal education.-Albert Einstein
  86. Oh, OK. Sometimes I'm just really stupid. by Ziwdam · · Score: 1

    I think I'm missing something.

    I see what I'm missing. Color nesting makes it hard. To get around that we can simply "move" color end tags if they're right before a color start tag to right after the next color end tag.

    Actually, we need to check the next set of start tags in general to see if we can use a plain tag. Of course, this makes it more inefficient...

    --
    It is a miracle that curiosity survives formal education.-Albert Einstein
  87. Doesn't sound too hard... by Ziwdam · · Score: 2

    ...but it might be hard to make it really fast. Maybe if you wrote it in assembly?

    A somewhat simple but slow way of doing it would be to create an array in which each non-tag character has a set of flags for bold, italic, whatever and a set of fields for color, size, etc. Then simply go through the newly created array and put in tags when ever the flags of fields change.

    It should be possible to optimize that... but I imagine significantly more efficient ways to do it will be found.

    I think this method will create highly optimized output... I can't think of anything to screw it up off the top of my head... but maybe I'm just missing something really obvious.

    Perhaps if some of the tags turn other tags off? I don't remember. That could screw it up.

    Comments?

    --
    It is a miracle that curiosity survives formal education.-Albert Einstein
    1. Re:Doesn't sound too hard... by monkey+typewriter · · Score: 1

      I don't think such a simple method will carry the day...

      Consider the input "b>x/b>r>x/r>b>x/b>"

      The one-pass array method (with a great number of assumptions on my part) would give us: "b>xr>xb>x/b>/r>&#60/b>"

      My patented "bit-better" method gives "b>xr>x/r>x/b>"

      I think the simple 1-pass method might even be in danger of failing the "stupidity" check they mention.

      --
      Ahh, my favourite rhetorical recipe, the tautological soffle.
  88. no ++ by kris_lang · · Score: 1

    C alone should be enough. PERL alone can handle it. C++ should not be needed.

  89. What about Icon or M/MUMPS/Cache by jsgraham · · Score: 1

    It seems to me that for reasons similar to the selection of SNOBOL, Icon and/or M/MUMPS/Cache would be ideal choices for this contest. Actually, I started with MUMPS and am ending up with Icon. A great, little known language. Steve Graham