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 00E79BC69 for ; Thu, 8 Mar 2007 20:40:04 +0100 (CET) Received: from ptb-relay01.plus.net (ptb-relay01.plus.net [212.159.14.212]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l28Je3OF019052 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Thu, 8 Mar 2007 20:40:04 +0100 Received: from [80.229.56.224] (helo=beast.local) by ptb-relay01.plus.net with esmtp (Exim) id 1HPOT4-0003wm-2g for caml-list@yquem.inria.fr; Thu, 08 Mar 2007 19:40:02 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Interactive technical computing Date: Thu, 8 Mar 2007 19:34:07 +0000 User-Agent: KMail/1.9.5 References: <200703080113.22721.jon@ffconsultancy.com> <1173356534.8655.6.camel@localhost.localdomain> <20070308.152439.98695201.Christophe.Troestler+ocaml@umh.ac.be> In-Reply-To: <20070308.152439.98695201.Christophe.Troestler+ocaml@umh.ac.be> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200703081934.07403.jon@ffconsultancy.com> X-Miltered: at concorde with ID 45F06693.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; christophe:01 troestler:01 gnuplot:01 umh:01 overloading:01 ocaml:01 vectors:01 matrices:01 camlp:01 matrices:01 notation:01 bigarrays:01 inference:01 ocaml:01 bankruptcy:98 On Thursday 08 March 2007 14:24, Christophe TROESTLER wrote: > I have written a Gnuplot module that allows that. Here is the > compulsory screenshot :) > > ftp://ftp.umh.ac.be/pub/ftp_san/Ocaml-gnuplot.png Great stuff. Thanks. :-) > Unless it is open source, I would not use such a product. Having it > open source is the only waranty for long term security. I would not > develop codes that cannot run 5 years later because, say, you > unfortunately went to bankruptcy... or you became crazy and ask 10 > times more money... or... I can't justify the time unless I get to sell something. :-) > > > Finally, I'd like to note that operator overloading is probably > > > the single biggest difference between my F# and OCaml code. The > > > ability to apply + and - to many types, particularly vectors and > > > matrices, makes this kind of work so much easier. > > That would not completely remove the problem of adding some operators > but I was thinking of a possibly generic solution using Camlp4: > writing [X.(a + b)] where [X] is a module would become [X.add a b]. > Now for matrices, one still needs + (for matrix addition), * (for > matrix multiplication) and, say, .* (for scalar product). So to be > generic, one needs to be able to specify a set of operators (with > precedences) and a way to transform an AST of that mini language into > Caml code (that would possibly allow some optimisations, analysing the > expression at compile time to reduce de number of intermediate > matrices allocated). A slicing notation also needs to be developed, > say [a.{1, 2:3:7}], as well as a good ASCII pretty printer for > matrices (they must be bigarrays to be able to use interesting > libraries). I don't think you can obtain F#'s brevity/clarity that way because you need to affect type inference and macros can't do that. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. OCaml for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists