Re: Very poor Lisp performance



In article <m2iry1q2j6.fsf@xxxxxxxxxxxxxxx>,
Peter Seibel <peter@xxxxxxxxxxxxxxx> wrote:
> > Presumably that is a Lisp-specific problem because Mathematica has no
> > problem using infix notation...
>
> I'm not sure it's been established that Mathematica has macros that
> are similar in power to Lisp's macros. If you want to see what an
> honest attempt to combine infix operators with Lisp-style macros looks
> like you should check out Dylan or (more recently) the Java Syntactic
> Extender[1]. However to understand the comparison you'll, of course,
> have to learn something about Common Lisp macros. And if you really
> want to go to town, look into Scheme's various macro systems which
> offer a slightly different take on the problem.

To Mathematica's credit its syntax always boils down to it's own
funny-looking sexprs:

(2 + {3, 4, 5}) ~Frob~ x is really Frob[Plus[2, List[3, 4, 5]], x]

So given that you can programmatically manipulate Mathematica symbolic
expressions, it's probably not a stretch to say that in theory you can
generate arbitrary code like you can with CL macros.

The problem, as mentioned in another branch of the thread here, is that
the Mathematica syntax is incredibly complicated to support some of this
flexibility, and the Mathematica evaluator is so /incredibly/ complex as
to basically prohibit understanding of what's going to happen when
things are evaluated, at least for me. There's certainly no concept of
"macroexpansion time" and "run time" like there is in CL, and there's no
simple QUOTE operator - things keep evaluating until they stop changing
unless wrapped in special Hold forms that have to stick with it to keep
it from evaluating in the future.

-bcd
--
*** Brian Downing <bdowning at lavos dot net>
.



Relevant Pages

  • Re: Very poor Lisp performance
    ... >> are similar in power to Lisp's macros. ... >> have to learn something about Common Lisp macros. ... > So given that you can programmatically manipulate Mathematica symbolic ... > it from evaluating in the future. ...
    (comp.lang.lisp)
  • Re: Evaluating Latex in Mathematica
    ... my LateX output using a mathematics evaluation environment (currently ... Mathematica allows you to paste LateX ... what to do with Macros. ...
    (comp.text.tex)
  • Re: something to chat about, lisp and Mathematica for list processing.
    ... If Lisp macros count then Mathematica replacement rules should count. ... kind of a read-applyrules-print loop. ...
    (sci.math.symbolic)
  • Re: Lisps QUOTE and Mathematicas "Hold"
    ... > mathematica does, and therefore that is how lisp does ... I was not trying to infer how Lisp evaluates ... So macros are the only remaining point of interest. ... functions mapping ASTs to ASTs. ...
    (comp.lang.lisp)
  • Re: Lisp and Scheme with fewer parentheses / Mathematica??
    ... Fateman (a well-known Mathematica hater) sullies Mathematica by ... Jon Harrop wrote: ... designed over the last 20 years, and before that there were languages ... Computer-assisted symbolic math is a special case for infix ...
    (comp.lang.lisp)