From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id E8C64BC0C for ; Sun, 4 Feb 2007 21:50:37 +0100 (CET) Received: from ptb-relay03.plus.net (ptb-relay03.plus.net [212.159.14.214]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l14KoaAN026432 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Sun, 4 Feb 2007 21:50:37 +0100 Received: from [80.229.56.224] (helo=[10.0.0.5]) by ptb-relay03.plus.net with esmtp (Exim) id 1HDoJm-0003IS-83 for caml-list@yquem.inria.fr; Sun, 04 Feb 2007 20:50:34 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Modeling tool for OCaml? Date: Sun, 4 Feb 2007 20:43:36 +0000 User-Agent: KMail/1.9.5 References: <1170603239.11113.11.camel@oxylin.no-ip.org> <55DE94DC-A1F7-4A30-85FC-9270FFD77509@seas.upenn.edu> <1170614508.4843.12.camel@oxylin.no-ip.org> In-Reply-To: <1170614508.4843.12.camel@oxylin.no-ip.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200702042043.37094.jon@ffconsultancy.com> X-Miltered: at concorde with ID 45C6471C.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 mutation:01 higher-order:01 variants:01 arrays:01 higher-order:01 iter:01 extensively:01 sig:01 frog:98 polymorphic:01 wrote:01 caml-list:01 functions:01 On Sunday 04 February 2007 18:41, Julien Peeters wrote: > I imagine that designing applications with functional languages is much > different than with imperative ones. > > I was wondering on which points the difference is significant? If you assume that by "imperative" you really mean "object oriented", as most of the main imperative languages are now OO (C++, Java, C# and Python), the difference is primarily that class hierarchies can often be represented more succinctly and efficiently using other constructs (like variant types) in functional programming languages like OCaml. > Does common oriented object design patterns can be used with OCaml? Most OO design patterns are redundant in OCaml. Basically, most OO design patterns solve problems creating by OO in the first place... > And what, for a developer, is the work to do to change his way of > thinking? Try to write your programs using a minimal amount of mutation, replace all loops with higher-order functions, leverage trees and pattern matching whenever possible. Forget about the advanced features of OCaml (objects, polymorphic variants) to start with. > I envisage to learn OCaml deeply and than I want to set the basis to do > the change from imperative languages to functional ones. Functional programming is often beneficial. I posted a simple OpenGL demo recently: http://www.ffconsultancy.com/free/bunny/ Although this is a very array-intensive program, operating on vertex and index arrays, it can still leverage functional programming by using the higher-order Array.iter and map functions extensively. > P.S. : somebody have reference books which goes over this subject? Yes, my book covers this subject (see my sig). -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists