Slashdot Mirror


ICFP 2001 Contest Results

Phil Bewig writes: "Results of the 2001 ICFP Programming Contest (previously mentioned at SlashDot here and here) have been announced. First place is to a program in Haskell, second place is to a program in Dylan, and the judges' prize is to a program in Erlang. The judges also named third place (ocaml) and fourth place (C) entries that were not awarded prizes. ICFP Programming Contest pages for prior years are available: 2000, 1999, and 1998."

8 of 100 comments (clear)

  1. The task by damiam · · Score: 4, Informative

    For those who don't want to click on all the links, the task was to produce a program that would optimise a HTML-like markup language called SML/NG. The programs had to remove excess whitespace, redundant and overlapping tags, and perform other simplifications.

    --
    It's hard to be religious when certain people are never incinerated by bolts of lightning.
  2. Re:Haskell, eh? by cthugha · · Score: 5, Informative

    I really recommend that you do sit down with Haskell. IMO, the judges were correct in naming it language of choice for "discriminating hackers". It has:

    • clean, simple syntax (parentheses are used only to override default infix operator precedences, nothing more), including excellent list construction and comprehension;
    • a strong object-oriented type system which ensures that the vast majority of coding errors result in a type error (although it can take a little while to get used to Haskell's type system);
    • lazy evaluation of expressions: only the parts of your program needed to produce a result are evaluated, which allows you to write programs that left to run would produce infinite computations (e.g. programs to calculate the Fibonnaci series or the sequence of primes) and only evaluate them for the subset of data you need; and
    • partially applied (or curried) functions: you really need to see these in practice, particularly in conjunction with the standard list-processing functions (e.g. map, scan, and fold) to understand their true power (the ability to create lists of partially-applied functions is very cool, although I have no idea how such things might be used).

    With regard to your qualms about lack of use, I understand Ericsson have created their own functional language for in-house use (the name escapes me). Arguably, since we've all got oodles of processor power to spare, there's no reason not to use functional languages in the general applications sector, given their greater reliability.

    If you want more info on Haskell, check out the official website (especially the Ode to Haskell on the humour page, which should give you an idea as to the language's feature set ;)). There you will find interpreters, compilers and other tools for a variety of platforms (incl. Windows and Linux) as well as complete documentation.

  3. Dylan links by menozero · · Score: 2, Informative

    More about the Dylan Hackers' entry; they use (and maintain) Gwydion Dylan.

    Functional Objects, Inc. sells Functional Developer, their Dylan implementation, for Windows and soon for Linux.

  4. Different ways of scoring by Anonymous+Brave+Guy · · Score: 3, Informative

    Just found this interesting analysis by the captain of the highly-placed Dylan Hackers entry. He uses his own sensible-sounding criteria for rating the entries, obviously somewhat different from the real judges', but not so far off in final results. It makes for an interesting alternative perspective.

    BTW, after I earlier posted that this shouldn't be taken as a fair comparison between programming languages, this information shows exactly why. The top entry is written in C++, and didn't figure in the "big five" mentioned by the judges of the real contest. In other words, the languages coming out on top change significantly, based on two different, but both reasonable, methods of ranking the entries.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    1. Re:Different ways of scoring by wocky · · Score: 2, Informative

      As the author of Beamer (the C++ program mentioned), I'll add one comment. The program uses a beam search and produces excellent results for all the tests on the machine I used for development. Unfortunately, that machine has 512MB of RAM, and the contest machine has 256MB. I discovered after the deadline that the priority queue used for generating the set of next candidates in the beam search can grow unreasonably large in some cases. For the last two test cases used, this is enough to start the thing thrashing in 256MB, and then it never finishes. A hard limit on the queue size wouldn't have affected the quality of the results, but hindsight is 20/20. Given the oversight, Beamer clearly didn't deserve to win. Lesson: set a reasonable data size limit when developing :-).

      --
      David
  5. Dylan by Earlybird · · Score: 4, Informative
    Dylan is a lovely, lovely language. At times awfully verbose in a way that reminds me of Ada, but its syntax and design is different. Its design is consistent and thoughtful, and the language is blissfully free of the cruft we see in C++ and Java.

    For example, Dylan's syntax is based on whitespace; so identifiers are permitted to contain most characters except whitespace and punctuation. (The downside, of course, is that you must type spaces around most operators. However, any character can be escaped with \, and you can even reuse reserved words this way.)

    This flexibility gives you a lot of freedom. For example, the official convention uses dashes to separate words; methods/functions that return a boolean value ends with ?; globals are surrounded by asterisks; and types are surrounded by angle brackets. So a method may be named is-camera-on?(), a global may named *game-clients*, and a class may be named <socket-server>.

    Dylan provides other small, but distinctive, features. For example, it supports per-file metadata: Any source file can start with an RFC 822-like header, which you'd typically use for version, author, copyright, license and documentation data.

    Of course, I haven't even started on the language features. Dylan has an interesting, elegant object model. It has explicit support for "slots", analogous to Delphi's class properties: data members whose access is delegated to accessor methods. It has explicit support for singletons and generic programming. It has multiple inheritance. It has garbage collection, type safety, a modern module system, etc. Dylan is usually compiled, but can be interpreted. Its extremely dynamic nature means that method dispatching and "smart linking" can be a complex affair; this is a weak link, and at least for Functional Developer (formerly Harlequin Dylan), program efficiency is dependent on the compiler being able to do "whole program" analysis.

    However, I would hesitate to call it a functional programming language. According to the Dylan reference manual, "Dylan is a general-purpose high-level programming language, designed for use both in application and systems programming". It is a structured programming language belonging to the same paradigm as C++ and Java. There are clear signs of having been influenced by functional programming, though.

    The name "Dylan" does not come from Bob or Thomas, but from the phrase "dynamic language".

    For more information, I recommend the Functional Objects site. They provide a Windows/Linux-based IDE and compiler for Dylan. The "Basic Edition" is free as in beer.

    1. Re:Dylan by andreas · · Score: 2, Informative

      Well, according to the definition, a functional language is one where functions are first-class objects. In mathematics, the term "functional" means "a function that can be applied to other functions".

      By this definition, Dylan is a functional langugage, it even supports currying, function composition and closures.

      But Dylan isn't a purely functional language, like Haskell is, but supports a mixture of other paradigms. Also, Dylan has no parametric polymorphism. In this sense, it's close to Scheme.

      And "Dylan" does come from Bob and Thomas, but Apple could never admit that, otherwise they would have lost quite some law suits.

  6. Re:Haskell, eh?-correction by affenmann · · Score: 2, Informative

    > a strong object-oriented type system which
    > ensures that the vast majority of coding errors
    > result in a type error (although it can take a
    > little while to get used to Haskell's type system);

    Yes, Haskell has a strong type system that finds many errors at compile-time. This is IMHO one of THE arguments why YOU(yes you) should use Haskell. It will make your programs better. But the type-system is not object-oriented. It uses type-classes to provide a way for overloading in the type-system. See this paper, for example.

    BTW. Did you know that, because of this type system, Haskell programs cannot segfault.?