Without knowing Lisp it is hard for me to really tell how valid your arguments are, but I must admit a couple of people who know both Lisp and Python have said Lisp would be easier. You are RJF are not the only ones to express that opinion.

Dave

Consider the MMA code as a source language and write a simple
compiler stage that translates that MMA code to a tree structure. You
have to do this in any modern compiler architecture. For this purpose you
can think of lisp as a "printable form of AST structures". So the lisp "data
structures" are just these parse trees. MMA parse trees are easy to make.

Lisp gives execution semantics to these AST data structures since, in lisp,
"data is code and code is data". So once you finish the first stage of your
compiler using "lisp as your AST target language" you're done. Just execute it.
In fact, lisp implements the rest of the compiler for you.

Axiom's Spad language does the same thing. The Spad language gets parsed
into an AST which just happens to be list data structures. These data structures also happen to be executable lisp. Gnu Common Lisp compiles the lisp code to C and GCC compiles the C code to machine code. So Spad algebra is "implemented" in machine code, or "implemented" in C, or "implemented" in lisp depending on where you want to focus. But all we had to write was the source-language (spad)
to-source-language (lisp) parser.

Writing in lisp gives you all the power of the python-cython but the whole
process is automated and you don't have to change "language" level. The
generated machine code is extremely efficient (matching Fortran machine
instruction sequences for numeric code).

So when a lisper sees the whole "rewrite it in cython to make it faster"
debate and hears that python is an interpretation-only language you can
begin to see why python seems so primitive. The whole interpreter/compiler
issue was solved and automated 30 years ago, only to be recreated by
python/cython in a more primitive, hand-processed form. Writing an MMA
compiler on top of the python/cython stack is a LOT more work and re-invents
technology that is 30 years old.

Just parse Foo[x] into (Foo x) and execute it. Problem solved.

Tim Daly

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to