Re: something to chat about, lisp and Mathematica for list processing.



On Jun 16, 1:26 pm, "Nasser Abbasi" <n...@xxxxxxxxx> wrote:
I thought everyone was bored this weekend, so I am strating a new
language-war topic :) (dont you love these topics?)

Lisp was one of the earliest programming languages I fell in love with, I
guess because I was fascinated with studying AI then (the language before it
was Fortran, and after lisp I fell in love with Pascal, then ...etc.)

But I have not used lisp for many many years now.

Fromhttp://en.wikipedia.org/wiki/Lisp_programming_languageit says : The
name Lisp derives from "List Processing".

And now I am using Mathematica more (for school work), and saw this in
Mathematica docs:

"Widely recognized as the world's most powerful list manipulation language,
Mathematica ..."

Topic for discussion: From only the list processing/manipulation point of
view, and nothing else, what would you consider the advantages/disadvantages
of one over the other?

I am sure by now, any kind of list processing task that can be done by one
language, most likely can just as well be done in the other.

So the question is not really asking about syntax or how many extra key
strokes needed to do the same list 'manipulation', but more along the lines
if there exist something inheritably more advantages of one language over
the other *when it comes to list processing*. I think one can argue than too
many [[[[[ ]]]]]] are harder to read than ((((( )))))) and I would probably
agree, but I remember also when I programmed in lisp I had problems making
sure the closing )))) matched the starting (((((, any way...I am thinking
more along the lines of a language design issues related to list processing
which might make one more suited for list processing than another.

May be someone here has more insight into both and educate us.

Nasser

I'm not going to address the main question but rather discuss some
underlying issues. I'll state in advance that this is my opinion only,
not necessarily shared by my employer.

Mathematica "lists" are akin to what might be called, arrays, vectors,
or tables elsewhere. Lisp lists are linked lists. These are very
different from the point of view of data structures and algorithms
thereon. Certainly I think Mathematica does wonderful things with its
List expression (and pretty much all other expressions). But a linked
list is, in my view, something that relies on the notion of a
"pointer" in order to be implemented and behave in a reasonable way.
This is something that one can emulate in various ways in Mathematica,
but the behavior is not always as good as might be desired.

Compounding this, I think, is the Mathematica notion of "infinite
evaluation". Some methods of linked list emulation might have
asymptotic complexity misbehavior due to reevaluation attempts that
might not be forestalled in all cases where they ought.

To an extent this might address the actual question. Mathematica is
good at working with its List structure. It is less proficient, though
by no means unable, to handle emulation of the sort of linked list
structure of Lisp.

Caveat: I last used Lisp more than 30 years ago. If I got it all
wrong, in the words of Ruth Buzzy, "Never mind".

Daniel Lichtblau
Wolfram Research












.



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: Cons cell archaic!?
    ... Lisp can use other, alternative representations ... of lists, without cons. ... what exactly each of these jargons means is ... pretty much dependent on the language now. ...
    (comp.lang.lisp)
  • Re: LISPPA
    ... >> of arbitrary objects in a programming language. ... I'm puzzled by the statement that "Pure functional Lisp ... lists of arbitrary-typed elements has to be functional. ...
    (comp.lang.lisp)
  • Re: Lisp collections
    ... If a programming language specification talks about a data type, ... For example, The Common Lisp Hyperspec talks about lists, ... misapprehension that Lisp programmers generally just used lists to store ...
    (comp.lang.lisp)
  • Re: SBCL is now faster than Java, as fast as Ocaml, and getting better
    ... amount to learn from Mathematica because it addressed so many of Lisp's ... What do you think Mathematica can learn from Lisp? ... are overestimating the "language merits" of Mathematica as far as its ... go beyond our discussion of Lisp, MLish and pattern matching. ...
    (comp.lang.lisp)