caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: padiolea@irisa.fr
To: "Robert Morelli" <morelli@cs.utah.edu>
Cc: "Alex Baretta" <alex@barettadeit.com>, "Ocaml" <caml-list@inria.fr>
Subject: Re: [Caml-list] (Mostly) Functional Design?
Date: Mon, 18 Jul 2005 20:56:12 +0200 (CEST)	[thread overview]
Message-ID: <1244.82.233.141.201.1121712972.squirrel@mail.irisa.fr> (raw)
In-Reply-To: <42DBF1C6.7080005@cs.utah.edu>

> Alex Baretta wrote:
>  > Your points are very simply wrong. Functional design addresses the same
>  > large-scale design problems that OO tries to address, and, in fact,
>  > given cognitive compatibility with the mind of the developere, it
> offers
>  > a productivity at least an order of magnitude greater on very large
>  > scale projects (over 100klocs) where the dominant cost factor is code
>  > maintenance. Ocaml's functional paradigm greatly stresses a priori
>
> With all due respect,  claims of order of magnitude productivity
> gains,  that OCaml is a far better language than Java,  etc.  are
> exactly the kind of advocacy that I think is counterproductive.

I agree. I think there is no silver bullet, and since the
ICFP programming contests I now realise that what matters are not
programming langages, but programmers. Good programmers even
in langage such as C by using advanced features such as function pointers,
macros can emulate higher order code, objects, ...

Nevertheless, I think that on the avergage, average programmers
can be better by using langage such as ocaml. It is just
that what you do by careful programming/experience/design-patterns
in some langages, is directly supported in other langage and so
easier for the average programmer to use.

There is some study comparing lisp, tcl, java, ... done on students
to solve a simple example and the numbers speaks for themselves.
Again, have a look at peter norvig webpage.
Recently richard jones have made a webpage where he presents
side by side the code of a raytracer done in caml and one done in c++.
This page is very interesting because there is no long boring
advocacy (such as what I am doing now) but a practical example.

> Most programmers would regard such dramatic statements as implausible,
> if not preposterous.

Yes I know, truth is sometimes hard to hear :)

You also have to realise that many features of java come from
the fp community: garbage collection,  generics,
and if I remember listeners for implementing callbacks
are examples of anonymous and higher order functions. In fact
Java was invented in part by golsing and steele who extensively
worked on scheme.
And in the same way some features of oo community have come in
the fp community (there is objects in ocaml),
or have influenced the fp commununity (there is type class in haskell)
It is not a black&white world.


>
>  > correctness via static type-checking, which we take advantage of to
>  > achieve static verification of the Embedded SQL queries in our FreerP
>  > suite of business applications. It is only thanks to the rich type
>  > system in Ocaml that we are able to maintain coherence between a
>  > database schema counting hundreds of relations and hundreds of Xcaml
>  > server pages containing at least as many embedded SQL queries. Java
>  > simply would not scale.
>
> The use of type checking is a point where the FP community
> has not reached consensus,

The same can be said in the OO community. Smalltalk, Clos, Self, Dylan
are weakly typed.
Java was also in some way weakly typed but since 1.5 with generics,
it is now better.

> as there are widely divergent views from
> the Scheme community and the ML and Haskell communities.  Even between
> ML and Haskell,  there are significant differences in the treatment of
> imperative features,  type inference,  objects and type classes,  etc.
> These differences,  it seems to me,  are more fundamental than anything
> you find in the OO world,

There are many differences in the oo world too, regarding covariance,
multiple inheritance, typing, ...

>  even the difference between,  say,  Java
> and Smalltalk.
>
> Moreover,  ML's traditional emphasis on type inference,  among other
> things,  puts demands and limitations on the type system.  Is type
> inference worth it?

yes :)

> Is there a consensus?

There is rarely consensus when it comes to programming langage, or
even programming tools.

> In fact,  most of the
> features that lie above the level of lambda calculus and syntactic
> sugar,  including the type system,  of FP langaugaes like OCaml seem
> more or less arbitrary to me.  Personally,  I see the OCaml type
> system as relatively weak.

So you think the same for java I guess.

> I'm intrigued by very powerful features
> like dependent types,  and I think they are dismissed too quickly by the
> mainstream of the FP community.  But that's just my view.  There's
> no consensus.
>
> In general,  I believe that OCaml and its approach to static typing
> are best suited to simple domains,

please stop qualifying  langage tools and formal methods as simple domains.

>  like language tools and formal
> methods.  These are characterized by dealing with objects which can
> be completely characterized by simple universal properties.  This
> fits well with the category theoretic foundation of the language.

I dont really understant what you mean here.

> But there are relatively few areas where you have such luxury,
> and even when it's possible,  finding the perfect characterization
> often requires rare intellectual gifts.
>
>



  parent reply	other threads:[~2005-07-18 18:56 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-14 18:00 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 [this message]
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

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=1244.82.233.141.201.1121712972.squirrel@mail.irisa.fr \
    --to=padiolea@irisa.fr \
    --cc=alex@barettadeit.com \
    --cc=caml-list@inria.fr \
    --cc=morelli@cs.utah.edu \
    /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).