Re: Survey: What led you to functional programming?
  Home FAQ Contact Sign in
comp.lang.functional only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Survey: What led you to functional programming?         

Group: comp.lang.functional · Group Profile
Author: Jon Harrop
Date: Sep 19, 2008 16:53

Szabolcs wrote:
> I am not a programmer. I learned about functional programming through
> Mathematica (not really a general purpose language, but it is very
> good at what it was designed for). Before that I only knew some
> BASIC, Pascal and a little 8086 asm. I enjoyed working with
> Mathematica a lot, and after I have used it for a few years, I tried
> to find a similar language that could replace C++ for high performance
> numerical computing tasks (in particular monte carlo simulation). I
> played a little with different languages but couldn't find anything
> that seemed suitable. Of course the language itself is not the only
> factor, it is important that there already be a community using the
> language for the same kinds of tasks. After all the most important
> thing is getting one's work done (note that I'm not a programmer), and
> having fun by learning a new language is secondary.
>
> But I am still open to suggestions, especially from people who do use
> functional language to write long-running numerical simulations.

OCaml and F# are both excellent in this respect (competitive with C++).
Statically-typed functional languages with good code gens are ideal for
numerics.

I believe this is very interesting from a programming language research
perspective because these languages have not traditionally been used for
this and, in particular, their implementations have had completely
different performance requirements because they were designed for symbolics
rather than numerics. For example, they typically have very fast (albeit
non-concurrent) GCs but poor optimization of floating point arithmetic.
This is true of MLton, SML/NJ, GHC and so on.

OCaml is a notable exception because it has an excellent x64 code gen (but
not x86!) for numerics but it has some limitations (e.g. no float32 type
and its naive optimizer requires "dumb" code). F# is another exception
because it inherits the performance characteristics of C#.

I believe there is substantial room for improvement with a new language and
implementation following similar lines but combining the benefits of OCaml
and F#, e.g. structural typing from OCaml and operator overloading from F#.
I would very much like to persue this but it is a lot of work and I do not
currently have the time to do it all myself...

--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?u
no comments
diggit! del.icio.us! reddit!

RELATED THREADS
SubjectArticles qty Group
Hypergeometric functions and beta functionssci.math ·