On 09/ 6/10 01:39 AM, Tim Daly wrote:


David Kirkby wrote:
On 5 September 2010 22:13, William Stein <wst...@gmail.com> wrote:
On Sunday, September 5, 2010, David Kirkby <david.kir...@onetel.net>
wrote:

RJF thinks Lisp is the best language
William thinks Python is God
No I don't.

I chose Python for Sage because in 2004 it was the closest popular
open source language to Magma.

God was the wrong word. But you have said Python is a beautiful
language. Your view of the language contrasts greatly with that of
RJF.

It's not clear to me the best way to tackle something able to parse
Mathematica.

It is however very clear there are far more people know Python than
Lisp, so use of Python is more attractive to more developers.

Dave

What does the number of python developers have to do with the question?

Quite a lot. If there was only one person working on the code, and that person knows Lisp, then the language is not a problem. But if one wants to extend the number of developers, then doing it in a popular language has *very* significant advantages. In much the same way as commenting the code in English is much more helpful that commenting the code in Swahili.

If we look at the problem domain it appears that the task is a
source-to-source
transformation followed by an execution of the result.

Which language makes this task easier?

MMA-to-lisp followed by execution involves changing MMA "data structures"
into lisp "data structures" which, because of the data-code equivalence
of lisp,
just involves evaluating the resulting expression in Maxima. It would be
possible
to write a Sage pexpect front end that takes MMA syntax as input, calls a
(translate-and-execute) function in Maxima, and returns the result. Thus
you get
both Maxima and MMA in the same code pile at little cost.

Maxima handles a very small subset of Mathematica.

MMA-to-python is a compiler task (lex/yacc/AST/codegen). The generated code
would have to know which subsystems would be involved because the syntax of
the calls vary. An alternative is an MMA interpreter, which is a lot of
work.
Adding MMA syntax to the python top-level would involve much more
pre-parser
effort in Sage, moving the Sage language farther from python than it
already is.


While they are conceptually equivalent tasks, the lisp version seems to
me to be
mechanically easier to implement. It is considerably more flexible and
more easily
extended. Lisp could easily add new syntax, something a MMA-to-python based
compiler would find a struggle.

Tim Daly

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

--
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