From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 0874ABCAE for ; Mon, 18 Jul 2005 20:56:15 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6IIuEKB021036 for ; Mon, 18 Jul 2005 20:56:14 +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 UAA02155 for ; Mon, 18 Jul 2005 20:56:14 +0200 (MET DST) From: padiolea@irisa.fr Received: from smtp.irisa.fr (smtp.irisa.fr [131.254.254.26]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6IIuDOY021033 for ; Mon, 18 Jul 2005 20:56:13 +0200 Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost.irisa.fr (Postfix) with ESMTP id 7F4B3FA92; Mon, 18 Jul 2005 20:56:13 +0200 (CEST) Received: from smtp.irisa.fr ([131.254.254.26]) by localhost (meli.irisa.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 02386-08; Mon, 18 Jul 2005 20:56:12 +0200 (CEST) Received: from mail.irisa.fr (melo.irisa.fr [131.254.254.28]) by smtp.irisa.fr (Postfix) with ESMTP id 8D447FA8F; Mon, 18 Jul 2005 20:56:12 +0200 (CEST) Received: from 82.233.141.201 (SquirrelMail authenticated user padiolea) by mail.irisa.fr with HTTP; Mon, 18 Jul 2005 20:56:12 +0200 (CEST) Message-ID: <1244.82.233.141.201.1121712972.squirrel@mail.irisa.fr> In-Reply-To: <42DBF1C6.7080005@cs.utah.edu> References: <9cc3782b05071411004b27b6a4@mail.gmail.com> <42DB6161.4030507@cs.utah.edu> <42DB74DC.8030201@barettadeit.com> <42DBF1C6.7080005@cs.utah.edu> Date: Mon, 18 Jul 2005 20:56:12 +0200 (CEST) Subject: Re: [Caml-list] (Mostly) Functional Design? To: "Robert Morelli" Cc: "Alex Baretta" , "Ocaml" User-Agent: SquirrelMail/1.4.5 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: by amavisd-new at irisa.fr X-Miltered: at nez-perce with ID 42DBFB4E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42DBFB4D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; irisa:01 caml-list:01 baretta:01 ocaml's:01 ocaml:01 icfp:01 pointers:01 ocaml:01 garbage:01 generics:01 callbacks:01 extensively:01 haskell:01 coherence:01 clos:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.2 required=5.0 tests=NO_REAL_NAME autolearn=disabled version=3.0.2 X-Spam-Level: > 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. > >