Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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:

  http://www.paulgraham.com/accgen.html

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
http://www.ffconsultancy.com/products/ocaml_for_scientists