English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Multi-Index Container
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-12-02 (00:58)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Multi-Index Container
On Thursday 01 December 2005 22:42, Mako Tagliere wrote:
> My colleagues and I often debate the relative merits of OCaml and C++.
> After I tell them how expressive, fast, and all-around nifty OCaml is
> ("see! the debugger works backwards in time!"), they reply "yeah but
> C++ has STL and Boost library, which make C++ every bit as expressive as
> OCaml."  When we repeated this debate recently, they challenged me to
> show them an implementation of Boost's multi-index container
> (http://www.boost.org/libs/multi_index/doc/index.html) in OCaml.  A
> bit of searching did not reveal an existing OCaml implementation.
> Would someone in the OCaml community be willing to sketch out such an
> implementation?

In order to compare different languages meaningfully, you should try to solve 
problems by writing independent implementations in different languages.

There is no point in trying to mimic individual features, paradigms or styles 
found in other languages, as you suggest. Paul Graham's infamous "accumulator 
generator" challenge is a fine example this mistake:


So you should ask your friends to try to come up with a real task with a C++ 
implementation that benefits from Boost's functionality, and then write your 
own implementation in OCaml before comparing the two.

I thought the examples from the page that you cite might have been suitable 
but the ones that I have looked at are all trivial in OCaml (and C++).

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists