From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id F17B6D17A for ; Wed, 27 Jul 2005 13:00:14 +0200 (CEST) Received: from pih-relay06.plus.net (fuzznuts.plus.net [212.159.14.133] (may be forged)) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6RB0E3V029665 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Wed, 27 Jul 2005 13:00:14 +0200 Received: from [80.229.56.224] (helo=chetara) by pih-relay06.plus.net with esmtp (Exim) id 1Dxje1-0006c4-CG for caml-list@yquem.inria.fr; Wed, 27 Jul 2005 12:00:13 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Some Clarifications Date: Wed, 27 Jul 2005 11:58:09 +0100 User-Agent: KMail/1.7.2 References: <6C6555DF5D075A4EA6D27706F4EC5975031677D4@EUR-MSG-10.europe.corp.microsoft.com> In-Reply-To: <6C6555DF5D075A4EA6D27706F4EC5975031677D4@EUR-MSG-10.europe.corp.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200507271158.09619.jon@ffconsultancy.com> X-Miltered: at nez-perce with ID 42E7693E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 syme:01 posts:01 ocaml:01 instructive:01 ocaml:01 compilers:01 stdlib:01 iirc:01 lablgtk:01 extensively:01 contrast:01 frog:98 wrote:01 ideally:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Wednesday 27 July 2005 10:38, Don Syme wrote: > For what it's worth, I found your posts genuinely interesting. I think there is something of interest worth discussing but most of it woul= d=20 be more appropriate on c.l.functional than here. I'd be happy to discuss th= is=20 there. Just replying to the OPs OCaml-related comments: I don't think that most=20 programmers use OO because it is the right tool for the job. I think they u= se=20 it either because it is forced upon them (Java) or because the language fai= ls=20 to provide alternatives (C++). OCaml is a useful case study here because it provides many alternatives.=20 You're not going to implement a closure via an object (as you would in C++)= =20 or a 3D vector via an object (as you would in Java), for example. So it is= =20 instructive to look at uses of OO in OCaml code. Of the OCaml code which I have studied, the OCaml compilers make scarce use= of=20 objects, the stdlib makes no use (IIRC), the third party data structures an= d=20 algorithms that I use also make no use of OO but lablgtk uses OO and I have= =20 one friend who has tried using OO in his own OCaml work. In my code, I have used an object once, in order to circumvent a typing=20 problem. I have never successfully used OO in OCaml. =46rom my point of view, it is interesting to compare graphics and GUI code= =20 which I have written in a classical FP style to a friend's who chose the OO= =20 approach because GUI code is a pedagogical example of OO design. Although i= t=20 is early days, I see no evidence that OO is any better than the classical F= P=20 approach at this task. > Part of what I think accounts for the popularity of OO in the real world = is > that it allows you to program in a very sloppy way in the early stages of > development without blowing your ability to muck with the way things > interact, and alter their behavior later in the development process. > Ideally, it allows you to build big, sloppy, poorly planned systems th= at > are nevertheless manageable to maintain.=20 My experience is exactly the opposite. I worked on a project for several ye= ars=20 which was written in C++ and which used OO extensively. Ultimately, we=20 ditched both C++ and OO in favour of OCaml and FP precisely because we want= ed=20 to make a few fundamental changes and those changes were simply too difficu= lt=20 for us to make successfully. In contrast, we have made many similarly=20 complicated fundamental changes to the OCaml code with no problems. So, despite reasonable understanding and planning beforehand, OO completely= =20 failed to allow us to maintain and develop the program. > I find that the facilities of a language like OCaml are so inadequate to > represent this domain, that using OCaml can be a distinct impediment. If you would like to discuss OCaml-related stuff then I'd like to hear more= :=20 specifically what it is you're working on, what you have tried and failed t= o=20 do in OCaml and why you think OCaml is "so inadequate"? =2D-=20 Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists