Re: Lisp and Scheme with fewer parentheses / Mathematica??
- From: Jon Harrop <usenet@xxxxxxxxxxxxxx>
- Date: Thu, 10 Jan 2008 23:51:25 +0000
Xah Lee wrote:
So, of course i'm not arguing that lisp and Mathematica have the same
evaluation models. I'm saying, as well as Jon is saying, that
programing in Mathematica is like in sense a glorified (or extened)
macros system as used in lisp.
Exactly.
In fact, one might argue, that the
concept of so-called rule-based system or term-rewritting is developed
from lisp. (after all, it is almost the case that any advanced
functional programing concepts has origin or trace of origin from
lisp, because after all, lisp is for all practical purposes the first
functional language and one of the oldest language)
Actually I would argue the opposite. Term rewriting is fundamental to
mathematics and predates Lisp and even the lambda calculus by hundreds if
not thousands of years.
PS It is not correct to say that Mathematica relies on pattern
matching or term-rewriting as its core computational model. Because,
in Mathematica, there are pure function ?Function? (lambda) construct,
as well as many imperative language constructs that cannot be
explained by pattern matching.
You might not be able to get far using pattern matching alone but you can
implement virtually everything using only term rewriting. This is exactly
how I bootstrapped my Mathematica JIT compiler in OCaml.
(a simple example: ?x++? or the
syntactically equivalent ?Increment[x]?) In fact, it is not possible
to write any non-trivial programs in Mathematica by using only pattern
matching. In my over a decade programing with Mathematica (mostly
active in the 1990s, i actually avoid pattern matching, for reasons
that in general pattern matching is somewhat unpredictable, and code
based on it is not so portable since other langs don't have it.)
Yes. One of the practical problems with Mathematica's pattern matching is
that it goes well beyond the linear patterns of ML and allows patterns to
have arbitrarily high asymptotic complexities. Consequently, the complexity
of almost any non-trivial pattern match is undefined.
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?u
.
- Follow-Ups:
- References:
- Lisp and Scheme with fewer parentheses / Mathematica??
- From: Xah Lee
- Re: Lisp and Scheme with fewer parentheses / Mathematica??
- From: Rainer Joswig
- Re: Lisp and Scheme with fewer parentheses / Mathematica??
- From: Xah Lee
- Re: Lisp and Scheme with fewer parentheses / Mathematica??
- From: Rainer Joswig
- Re: Lisp and Scheme with fewer parentheses / Mathematica??
- From: Xah Lee
- Lisp and Scheme with fewer parentheses / Mathematica??
- Prev by Date: Re: Lisp and Scheme with fewer parentheses / Mathematica??
- Next by Date: Re: macrolet abuse?
- Previous by thread: Re: Lisp and Scheme with fewer parentheses / Mathematica??
- Next by thread: Re: Lisp and Scheme with fewer parentheses / Mathematica??
- Index(es):
Relevant Pages
|