Python vs Lisp: was RE: how to pass the name of a variable as argument?
Subject: Python vs Lisp: was RE: how to pass the name of a variable as argument?
From: Dave
Date: Thu, 15 May 2008 00:52:19 -0500
On Wed, May 14, 2008 at 09:19:07PM -0700, Richard Fateman wrote:
>
>
>> -----Original Message-----
>> From: Robert Dodier [mailto:robert.dodier at gmail.com]
>> Sent: Wednesday, May 14, 2008 8:58 PM
>> To: Dave
>> Cc: Richard Fateman; maxima at math.utexas.edu
>> Subject: Re: [Maxima] Python vs Lisp: was RE: how to pass the
>> name of a variable as argument?
>>
>> On 5/14/08, Dave <dfeustel at mindspring.com> wrote:
>>
>> > Would using Haskell for the top level be feasible?
>>
>> That seems interesting, mostly, from my point of view, because
>> Haskell has built-in pattern matching. I don't know anything about
>> it, but it seems likely it is more powerful than Maxima's pattern
>> matching.
>
>Does Haskell's pattern matching include rational simplification and
>knowledge of identities under addition and multiplication?
>There are 3 pattern matchers in Maxima, and another could be loaded in
>(corresponding approximately to the pattern matcher in Mathematica version
>3.0).
>
>One issue with taking a language that you like and having it "call Maxima"
>is that most languages cannot do much of anything with the return value
>unless the return value is numeric.
>
>Thus it is entirely possible, in some circumstances, for FORTRAN to call
>Maxima. But if the answer is, say,
>x^2+sin(y+3.141592623442343423424234324343423234234342423)
>
>what is FORTRAN going to do?
>Deconstruct an algebraic tree?
>Take the answer as a string and, uh, reparse it, turning it into an
>algebraic tree?
>Print it out?
>
>The situation is not entirely different if you substitute Python for
>FORTRAN.
>
>And if use another language for the top level, you need to deal with quoting
>and evaluation. Lisp knows about symbols and such. There is a symbol table
>that lives at run-time. This is very handy for symbolic math.
>Some languages do not have such a run-time structure, or if they do, it is
>not easily accessible to the programmer (that is, it is used by the
>debugger). I don't know how these issues are addressed in Haskell.
>RJF
>>
>> If there were an implementation of Haskell in Lisp, it would
>> theoretically be straightforward to try it -- just launch Maxima
>> and load Haskell into the image and somehow call a Maxima
>> function from Haskell ... If you have time to try it,
>> I would be interested to hear how it turns out.
>>
>> best
>>
>> Robert Dodier
In view of your interest in pattern matching, I suggest Snobol4
as a possible front end for Maxima. Snobol4 is the best pattern
matching and manipulation language I have used. It's available
in a very nice C implementation at Phil Budne's website at
http://www.snobol4.org/csnobol4/curr/. This is typically one
of, if not the first, programs I install on my computer every
time I load an OS,
Snobol4 is almost as old as Lisp. It was developed at Bell
Labs prior to Sed and Awk. It is the ultimate Swiss army knife
of software.