From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA10081 for caml-redistribution; Mon, 15 Sep 1997 08:38:41 +0200 (MET DST) 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 TAA02747 for ; Sat, 13 Sep 1997 19:30:15 +0200 (MET DST) Received: from postbox.dai.ed.ac.uk (postbox.dai.ed.ac.uk [129.215.41.196]) by nez-perce.inria.fr (8.8.7/8.8.5) with SMTP id TAA29930 for ; Sat, 13 Sep 1997 19:30:12 +0200 (MET DST) Received: from venus (venus.dai.ed.ac.uk [129.215.41.154]) by postbox.dai.ed.ac.uk (8.6.13/8.6.12) with ESMTP id SAA13644; Sat, 13 Sep 1997 18:30:11 +0100 Date: Sat, 13 Sep 1997 18:30:10 +0100 Message-Id: <6033.199709131730@venus> From: William Chesters To: caml-list@inria.fr Cc: Basile.Starynkevitch@cea.fr Subject: Re: Q: Caml for number crunching and/or scripting? Sender: weis Basile Starynkevitch writes: > Hello All, > > Are there anyone using CAML or Ocaml > > for numerical/physical/scientific applications (maybe number crunching) > > as an embeddable scripting langage > > (both are possible: using CAML as a scripting langage driving low > level -eg Fortran- numerical routines) Yes, I use it for both actually. I've used camlp4 (much recommended btw) to extend the syntax of ocaml so that I can write matrix/tensor calculations using the summation convention: tens v[I J] += w[I K J L] b[K L] + k a[I J] and have a very efficient loop to do the work inserted automatically, in C or in ML. I keep the matrices in Fortran layout so that I can use Lapack routines on them. Using ocamlopt's -output-obj option you can even squeeze in a call initialise the f2c libraries at startup time. I've also taken to using ocaml for scripting jobs that are more complicated than Perl can comfortably handle. It's interesting that ML's background as a very abstract language gives it some of the conciseness and convenience of Perl, but without the flakiness. On the other hand I'd rather have Perl's than emacs's regexps ...