[Haskell-cafe] Why are OCaml and Haskell being used at these companies?

Laurent Deniau laurent.deniau at cern.ch
Tue Nov 13 11:03:58 EST 2007

Jules Bean wrote:
> Laurent Deniau wrote:
>> Henning Thielemann wrote:
>>> On Tue, 13 Nov 2007, Jon Harrop wrote:
>>>> the FFT routines in MATLAB (FFTW: written in OCaml) and the SML 
>>>> software
>>>> that The MathWorks sell.
>>> I see, but FFTW was not developed by MathWorks, but by Matteo Frigo and
>>> Steven G. Johnson (says fftw.org),
>> Right, and it is not written in OCaml but in C. The OCaml code 
>> _generates_ optimized C code for the arch where it matters.
> That sounds like 'written in ocaml' to me.

OCaml was used to write a meta-program which applies heuristics to 
minimize the runtime of the critical C code (i.e. the butterflies). This 
has nothing to do with FFT computation and it is optional. FFTW doesn't 
need any OCaml compiler or lib to be compiled and installed.

> That's no more written in C than java code is written in assembly, just 
> because the JIT generates optimised assembly code...

If your program is written in Java (resp. C) but the JIT is written in C 
(resp. OCaml), in which language is your code?

> I would say it's "written in" the language which the authors wrote it. 
> The fact that they wrote it to generate some C code and then compile it: 
> well, they're just a clever bunch :-)

Effectively, they have used the right language for the right thing.

a+, ld.

More information about the Haskell-Cafe mailing list