English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
(Mostly) Functional Design?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-07-18 (18:15)
From: Robert Morelli <morelli@c...>
Subject: Re: [Caml-list] (Mostly) Functional Design?
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.
Most programmers would regard such dramatic statements as implausible,
if not preposterous.

 > 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,  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,  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?  Is there a consensus?  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.  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,  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.
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.

I am not familiar with your FreerP technology and its use of Xcaml,
but I will not dispute your claim of great success.  It just seems
likely to me that you've taken advantage of uncommon insight to
cast your problems into a new sort of niche application.  Relational
algebra is after all not so far from category theory.  Perhaps you've
found an approach that could be used in many more applications to
business.  If so,  I wish you success.