Version française
Home     About     Download     Resources     Contact us    
Browse thread
Interactive technical computing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Interactive technical computing
On Thursday 08 March 2007 20:34, Christophe TROESTLER wrote:
> Of course, when mixing vectors and matrices, we will not be able to
> stay with only + and * but I am not sure that having to put type
> annotations will compare favorably to put the expression in Mat.(...)
> and inventing a _few_ additional operators.

Many arithmetic expressions mix different types.

> Moreover I think that, in some respects, it is even better than
> overloading!  For example if you write
>
>   # Vec.(a + b + c)
>
> then Camlp4 could generate code that only needs to create 1 temporary
> vector to hold the result instead of 2 (as is the case in F#).

I would expect the compiler to automate that deforesting.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists