From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 18065D56D for ; Wed, 27 Jul 2005 18:23:26 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j6RGNPPK014034 for ; Wed, 27 Jul 2005 18:23:25 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA25371 for ; Wed, 27 Jul 2005 18:23:25 +0200 (MET DST) Received: from wetware.wetware.com (wetware.wetware.com [209.218.58.1]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6RGNOxU031788 for ; Wed, 27 Jul 2005 18:23:24 +0200 Received: from [69.12.155.90] (helo=[10.0.1.5]) by wetware.wetware.com with esmtp (Exim 4.43) id 1Dxogl-0003lG-Hn for caml-list@inria.fr; Wed, 27 Jul 2005 09:23:23 -0700 Mime-Version: 1.0 (Apple Message framework v733) In-Reply-To: <200507271158.09619.jon@ffconsultancy.com> References: <6C6555DF5D075A4EA6D27706F4EC5975031677D4@EUR-MSG-10.europe.corp.microsoft.com> <200507271158.09619.jon@ffconsultancy.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: james woodyatt Subject: Re: [Caml-list] Some Clarifications Date: Wed, 27 Jul 2005 09:23:22 -0700 To: Ocaml Trade X-Mailer: Apple Mail (2.733) X-Miltered: at concorde with ID 42E7B4FD.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42E7B4FC.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; woodyatt:01 jhw:01 wetware:01 caml-list:01 ocaml:01 ocaml:01 compilers:01 stdlib:01 iirc:01 lablgtk:01 reuse:01 recursive:01 orthogonal:01 woodyatt:01 jhw: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 27 Jul 2005, at 03:58, Jon Harrop wrote: > > Of the OCaml code which I have studied, the OCaml compilers make > scarce use of > objects, the stdlib makes no use (IIRC), the third party data > structures and > algorithms that I use also make no use of OO but lablgtk uses OO > and I have > one friend who has tried using OO in his own OCaml work. In the first pass through at my functioanl reactive I/O [Iom] library in OCaml NAE, I managed to get a lot done without using any objects. In general, this produced tighter code, but it was less adaptable than I wanted it to be, and I found it hard to reuse parts of reactors. Sure, reactors themselves were highly reuseable, but I found myself wanting to make a framework of very similar reactors all built out of some common functions. A reactor was typically written as a huge bundle of mutually recursive monad functions, and it was a major pain to separate the reusable functions from the rest of the bundle. In my recently announced refactoring of the [Iom] library, I found I could get more adaptability by using the object system. In the new code, reactors can be written as classes (even pure functional classes) and the monad functions implemented as methods. It makes the challenge of designing a general purpose reactive I/O framework a lot easier. The problem of separating the reusable functions from the rest of the bundle is resolved by implementing a class with virtual methods. I doubt this hybrid approach, combining both FP and OO, could be used in any other language I know about. From my perspective, FP and OO are orthogonal and not mutually exclusive techniques. Once you decide to use OO for what it really does, and which FP doesn't, I think you find that what it has to say about large-scale software development is a lot less than what most practitioners think. This is because you're right: most programmers don't use OO because it's the right tool for the job; most use it because it's inappropriately forced on them by a language that doesn't provide reasonable alternatives for things that don't need OO to enable. -- j h woodyatt markets are only free to the people who own them.