Re: What's so great about lisp?



Pisin Bootvong wrote:
>>Yes. Lisp forces you to "jump through the hoop" of converting the numbers
>>into some representation that happens to be exact in Lisp. For this
>>example, Mathematica does not require the same hoop jumping because it
>>tracks numerical errors in floating point arithmetic:
>
> My ideal user friendly Lisp in this regard would be Lisp that
> automatically convert floating point literal to rational.

The problem is that rationals have very different properties.

> 1.3 literal can be converted to (/ 13 10).

The representation used by Mathematica tracks numerical error, so it is not
equivalent to 13/10.

> In case one really wants IEEE float, one can always use declaration.

Also, it is not IEEE float.

> There's probably no surprise wrt to the behavior of the program, most
> people would expect rational like behavior than the IEEE bahavior
> anyway.

I think most people would expect mathematical behaviour, which isn't
possible on a computer.

>> (defun fact (n) (if (< n 2) n (* n (fact (1- n)))))
>>...
>>So Lisp "beats" SML and OCaml on that example, but not Mathematica:
>>
>>In[1]:= 120!
>
> What's the point of this example? To show that Mathematica has built-in
> fact function and Lisp don't?

In this case, yes. Mathematica implements a wide variety of functions (e.g.
Gamma) that Lisp does not. So I would not hold up Lisp's numerical tower as
an example of something that makes the language great. It simply puts Lisp
in the middle, between C++ and CASs for example.

> Does Mathematica have built-in condition system like Common Lisp?

It has pattern matching with optionally guarded patterns. I think that
serves the same purpose.

> Should we try to compare number of line of code and effort you have to
> spend to implement that in Mathematica?

Can you give an example of a simple problem and implementation using Lisp's
condition system?

Also, there is also a problem here - Mathematica code is usually typeset, so
it doesn't make sense to compare by LOC. Still, it'll be interesting to
have a look.

> I am sure Mathematica will have trouble beating Common Lisp on that.

I doubt it. :-)

> Line of code in Lisp for condition system will be 0. As is
> Mathematica's Line of code for fact function.

Yep.

> Now would you choose the language that you have implement fact function
> yourself or the language that you have to implement Condition System
> yourself? :-)

That depends upon the application. Right now, Lisp is looking most promising
for writing fast interpreters. Obviously, Mathematica isn't going to
compete there. :-)

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com
.



Relevant Pages

  • Re: why do you choose LISP?
    ... i like lisp primarily bceause it is a functional lang. ... It is also during the early 1990s, i started to learn programing on my ... during these years i bought Mathematica (because i heard it's the ... I do not have any concrete idea what IS a language specification ...
    (comp.lang.lisp)
  • Re: Lisp and Scheme with fewer parentheses / Mathematica??
    ... Any dummy, at our level, knew that Mathematica and lisp have different ... programer, even with say 10 years of programing experience, chances ... functional language and one of the oldest language) ...
    (comp.lang.lisp)
  • Re: Lisp syntax vs. Mathematica syntax
    ... Let's trying writing a Lisp macro equivalent to Mathematica's Apply. ... In Mathematica, ... That's not what Lisp folks mean when they ... > What you are doing is not the same as other programming environments. ...
    (comp.lang.lisp)
  • Re: Benefits of Dynamic Typing
    ... Mathematica implements everything that you've listed from Lisp and adds ... > syntax for for representing data externally predefined ... Mathematica takes this further by allowing 2D typesetting of expressions. ...
    (comp.lang.functional)
  • Re: Whats so great about lisp?
    ... My ideal user friendly Lisp in this regard would be Lisp that ... automatically convert floating point literal to rational. ... To show that Mathematica has built-in ... Does Mathematica have built-in condition system like Common Lisp? ...
    (comp.lang.lisp)