caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* (Mostly) Functional Design?
@ 2005-07-14 18:00 Kyle Consalus
  2005-07-18  7:59 ` [Caml-list] " Robert Morelli
  0 siblings, 1 reply; 66+ messages in thread
From: Kyle Consalus @ 2005-07-14 18:00 UTC (permalink / raw)
  To: caml-list

There are a wealth of resources related to object oriented design techniques
(which can certainly be applied to OCaml), but I've been pretty much unable
to find any good resources on large scale design of functional programs.
I realize that this is the sort of thing that develops over time with
experience.
Just the same, there is (most likely) a lot to learn and consider, and a 
resource would be helpful. My recent uses of OCaml for fairly small projects
have been effective, but a lot of things were cumbersome in the design
and I suspect that I may be thinking about it wrong.
So, could anyone suggest a good resource or perhaps weigh
in on their thoughts on the topic?

Thanks,

Kyle


^ permalink raw reply	[flat|nested] 66+ messages in thread
* RE: [Caml-list] Some Clarifications
@ 2005-07-27  9:38 Don Syme
  2005-07-27 10:58 ` Jon Harrop
  0 siblings, 1 reply; 66+ messages in thread
From: Don Syme @ 2005-07-27  9:38 UTC (permalink / raw)
  To: Robert Morelli; +Cc: Kyle Consalus, caml-list


Hi Robert,

For what it's worth, I found your posts genuinely interesting.

Best wishes,
Don


-----Original Message-----
From: caml-list-bounces@yquem.inria.fr
[mailto:caml-list-bounces@yquem.inria.fr] On Behalf Of Robert Morelli
Sent: 19 July 2005 21:15
To: Robert Morelli
Cc: Kyle Consalus; caml-list@yquem.inria.fr
Subject: [Caml-list] Some Clarifications

In the interests of saving time,  and keeping my post to a palatable
length,  I stated my contentions as unsupported assertions.  I intended
to elaborate only those points that aroused debate.  Unfortunately,
people have already misconstrued or protested every single statement
I've made,  so this thread has grown beyond the point I want to deal
with in detail.

Let me just try to explain what I think the essential distinction
between OO and FP programming is.  In FP you ideally capture the essence
of your data in your data structures.  In other words,  they are ideally
wholly characterized by their data type.  This is the reason conciseness
is considered a virtue in FP,  because verbosity is likely evidence of a
conceptual error.  That's not so in OO (with its associated problem
space),  where you model things whose existence you know,  but whose
essence you may not be able to capture in the language,  its type and
class systems,  or even in your head.

FP languages can handle such things to a greater of lesser extent,
but FP languages have many technical and practical disadvantages,
so it often doesn't make sense to use them in such a way.  And
the further you deviate from the ideal,  the less a rigid type
system helps keep your software sound,  and the more it gets in your
way.

One of the areas where I do much of my programming is in mathematical
software.  I view this as one of the most difficult areas,  at the
opposite extreme from simple domains like formal methods and language
tools.  The problems with characterizing mathematical objects come
up peripherally here with representations of numbers.  This always leads
to endless,  inconclusive discussions of issues like operator
overloading,  inheritance and multiple inheritance,  multiple dispatch,
multiple views of a data structure,  constraints, etc., etc.  And that's
just the tip of the iceberg.  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.  Sometimes Java is a better fit.
Not always,  but sometimes.

The fundamental point is that OO puts interaction at the
center of the paradigm,  not abstract characterization.  That has
huge consequences and it's what makes the whole idea of a "theory"
of large scale design meaningful.  OO commits to a certain way of
organizing interaction,  state changes,  behavior changes, ....  that's
attractive in practice (but requires deeper theory than FP).

Consider the following historical example.  Milner,  the creator of ML,
began trying to grapple with the concept of interaction and concurrency
in the early 1970's.  His first attempt was to use a functional approach
with higher order functions.  That was a failure.  Ultimately,  he ended
up creating the process algebra CCS (and later went on to the
pi-calculus).  Milner's CCS,  and his account of it,  have a striking
resemblance to the OO interactive paradigm,  and completely abandon FP
concepts.  This despite the fact that he created ML in the very same
period,  and had no involvement with the OO projects of the time.  In
the past decade,  concurrent object calculi have been proposed as
foundations of the OO paradigm.  They look very much akin to things like
the pi-calculus.  Haskell's concurrency also has a pi-calculus like
semantics.

Some other historical perspectives ... 1.  At the same time,  Smalltalk
and Xerox PARC was underway,  and within a few years,  the Mac hit the
scene with its OO influenced interactive GUI -- arguably the most
important development in the history of software development.
2.  Simula,  the first OO language,  and one of the most influential
languages of all time,  was developed about a decade earlier.
Simula's objects had a built-in notion of concurrency,  intended to
model interactive queuing networks.
3.  Within a decade or so,  OO based RAD visual development tools like
Visual Basic hit the scene and quickly gained enormous influence.
Is there even an FP analog of building software that way?
4. Over the decades,  both hardware and software technologies have
inexorably evolved toward networked,  decentralized,  componentized
systems.  Even CPU's are now trending toward multicore designs.  This
makes the sequential computational model that FP is based on seem less
and less central.

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 that are nevertheless manageable to maintain.  In the real
world,  almost all programmers are hackers,  with limited capacity for
forethought,  so this is an attractive feature.

It's sometimes claimed that OCaml's type system gives you a similar
advantage,  allowing you to quickly pinpoint all of the consequences
of a design change.  But that's a rather different technique.

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


^ permalink raw reply	[flat|nested] 66+ messages in thread
* Re: [Caml-list] Some Clarifications
@ 2005-07-27 14:32 David Thomas
  0 siblings, 0 replies; 66+ messages in thread
From: David Thomas @ 2005-07-27 14:32 UTC (permalink / raw)
  To: caml-list


ADT's have traditionally been written in OO style. 
The thing that makes "OO programming" different from
traditional programming is that the same methodology
is extended to every component of the program. 
While yes, a stack with "push" and "pop" methods is an
ADT, surely a text widget is not, even if coded in
very much the same style.


--- Ville-Pertti Keinonen <will@exomi.com> wrote:

> David Thomas wrote:
> 
> > Any time you write a program that focuses on the
> > components as "data and operations on that data,"
> > you have written an OO program.  
> 
> Not according to traditional terminology.  What
> you've done is used Abstract Data Types, which is
one 
> of the most basic forms of abstraction that anyone
> should learn in any programming language.
>
> Of course I've seen quite a few programmers who
> don't have enough discipline to use consistent 
> abstractions unless they're forced to encapsulate
> things in classes.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


^ permalink raw reply	[flat|nested] 66+ messages in thread

end of thread, other threads:[~2005-07-28  0:29 UTC | newest]

Thread overview: 66+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-14 18:00 (Mostly) Functional Design? Kyle Consalus
2005-07-18  7:59 ` [Caml-list] " Robert Morelli
2005-07-18  9:22   ` Alex Baretta
     [not found]     ` <42DB78D3.7010401@andrej.com>
2005-07-18 10:01       ` Alex Baretta
2005-07-18 18:15     ` Robert Morelli
2005-07-18 18:45       ` Alex Baretta
2005-07-18 18:56       ` padiolea
2005-07-18 19:19         ` Jon Harrop
2005-07-18 19:38       ` Jon Harrop
2005-07-18 21:27       ` skaller
2005-07-18 21:55         ` Alwyn Goodloe
2005-07-18 22:16         ` Paul Snively
2005-07-19  0:45           ` Jonathan Bryant
2005-07-18 21:37       ` skaller
2005-07-18 22:00     ` Kenneth Oksanen
2005-07-18  9:29   ` Mark Meyers
2005-07-18  9:56   ` Large scale and FP (was: Re: [Caml-list] (Mostly) Functional Design?) David MENTRE
2005-07-18 18:11     ` Large scale and FP Robert Morelli
2005-07-18 14:08   ` [Caml-list] (Mostly) Functional Design? james woodyatt
2005-07-18 16:37     ` Alwyn Goodloe
2005-07-18 14:21   ` alphablock
2005-07-18 15:26     ` Alex Baretta
2005-07-18 15:38       ` alphablock
2005-07-18 17:17       ` Doug Kirk
2005-07-18 18:14         ` Alex Baretta
2005-07-19  7:42         ` james woodyatt
2005-07-19  9:35           ` Robert Morelli
2005-07-19 16:53             ` james woodyatt
2005-07-19 17:13               ` Paul Snively
2005-07-19 23:58                 ` Jon Harrop
2005-07-20  0:29                   ` Paul Snively
2005-07-18 18:23   ` padiolea
2005-07-18 19:45   ` Gerd Stolpmann
2005-07-18 22:16     ` skaller
2005-07-19  0:48   ` Chris Campbell
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
2005-07-22  5:18   ` [Caml-list] (Mostly) Functional Design? Marius Nita
2005-07-27  9:38 [Caml-list] Some Clarifications 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
2005-07-27 14:32 David Thomas

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).