MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Functional programming?

Andrzej Kozlowski wrote:
> On 17 Sep 2008, at 08:26, David Bailey wrote:
>> I feel there is another thing to say regarding FP. The fact that FP
>> performs so well in Mathematica is, in my opinion, something of a  
>> fluke.
>> The real reason is that because Mathematica is such a high level
>> language, absolutely every step incurs considerable overhead, that is
>> not present in languages such as Fortran or Java. Because FP  
>> provides a
>> way to do a lot in one step, it reduces this overhead.
> I don't think it is a fluke, but simply a consequence of the fact that  
> Mathematica is or originated as a Computer Algebra System, and there  
> is no doubt that functional programming is the most efficient and  
> natural way to program in a CAS. I don't think there is any point even  
> arguing about this so I just  note that the first (at least I think it  
> is the first) genuine CAS system did not even have its own programing  
> language but used LISP  (the paradigm of all functional languages),  
> and one of Mathematica's main rivals, which uses a procedural  
> programming language (in my opinion a pretty awful one), had   
> functional constructs belatedly added to it.
> Andrzej Kozlowski
I agree, what I meant was that FP's advantage over PP only exists in 
environments such as Mathematica. An FP extension to Java (say) would be 
no faster than an equivalent regular Java program - because both would 
be ultimately translated into the same machine instructions. BTW, modern 
Java is fully compiled just prior to execution.

I think the mixture of FP and PP constructs in Mathematica is ideal.

David Bailey

  • Prev by Date: Re: imagesize to full width of current screen
  • Next by Date: Re: Problem with replacement rules
  • Previous by thread: Re: Re: Functional programming?
  • Next by thread: Re: Functional programming?