caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: james woodyatt <jhw@wetware.com>
To: Ocaml Trade <caml-list@inria.fr>
Subject: Re: [Caml-list] Some Clarifications
Date: Wed, 27 Jul 2005 09:23:22 -0700	[thread overview]
Message-ID: <B2CCBDDA-6B4E-4CF2-8B2B-6EAD103322FA@wetware.com> (raw)
In-Reply-To: <200507271158.09619.jon@ffconsultancy.com>

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 <jhw@wetware.com>
markets are only free to the people who own them.


  parent reply	other threads:[~2005-07-27 16:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-27  9:38 Don Syme
2005-07-27 10:58 ` Jon Harrop
2005-07-27 11:55   ` Robert Roessler
2005-07-27 14:01     ` Richard Jones
2005-07-28  0:29       ` Robert Roessler
2005-07-27 18:42     ` skaller
2005-07-27 13:36   ` David Thomas
2005-07-27 13:53     ` Ville-Pertti Keinonen
2005-07-27 16:23   ` james woodyatt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-07-27 14:32 David Thomas
2005-07-14 18:00 (Mostly) Functional Design? Kyle Consalus
2005-07-18  7:59 ` [Caml-list] " Robert Morelli
2005-07-19 20:14   ` Some Clarifications Robert Morelli
2005-07-20  6:18     ` [Caml-list] " Ville-Pertti Keinonen
2005-07-24  0:04       ` Robert Morelli
2005-07-24  2:30         ` Paul Snively
2005-07-24  7:37           ` Alex Baretta
2005-07-24  8:08           ` Robert Morelli
2005-07-24 12:23             ` David Teller
2005-07-24 18:29             ` skaller
2005-07-24 18:51             ` Paul Snively
2005-07-24 12:42         ` Gerd Stolpmann
2005-07-25  7:23         ` Ville-Pertti Keinonen
2005-07-20  7:34     ` David MENTRE
2005-07-27 15:37       ` Robert Morelli
2005-07-27 20:33         ` skaller
2005-07-27 23:48           ` Paul Snively
2005-07-20 16:28     ` Damien Doligez
2005-07-24 14:51       ` Robert Morelli
2005-07-24 16:11         ` David MENTRE
2005-07-25 12:21         ` Damien Doligez
2005-07-25 15:47           ` Richard Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B2CCBDDA-6B4E-4CF2-8B2B-6EAD103322FA@wetware.com \
    --to=jhw@wetware.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).