Re: XML, why Mma is popular



Note - sorry if an incomplete one went out.

--- Richard Fateman <fateman@cs.berkeley.edu> wrote:

> The key lesson of Mathematica's success is, I think, disturbing.
> That is, marketing and glitz was more important than efficient,
> reliable and comprehensive mathematical computation. Technical
> achievement was not critical since most came years later.

This is a lesson of the commercial software world in general, and I
agree it is indeed disturbing.  In some cases the arguement could
perhaps be made that an easier interface on an inferior product makes
more sense for occasional use, but not in the case of mathematics.  And
I personally find Maxima easier to use, at least syntax wise.
 
> Regarding XML:  it is simply inadequate to convey mathematics
> between two programs intending to compute with it, rather
> than just display it.

I may be confused about what's under discussion here, but XML itself
doesn't have much to do with mathematics - it's MathML that defines
those standards.  I agree MathML is not the way to go for communication
between programs.  It IS a logical and desirable display mode, since it
looks to be the standard in web browsers, but that is a document export
format rather than a communications protocal.  I suspect a useful
analogy might be Word's doc format vs. rich text format - you want to
be able to export to rich text format so people can see the document,
but for expressing all the functionality and information Word wants rtf
wouldn't cut it.

> There must be another (separate) "contract" between each program 
> and XML. Mathematica has ArcTan where macsyma has atan.
> Mathematica reverses the arguments to some functions e.g. atan2.

That reminds me, we should put it on our task list to take mockmma's
ability to handle Mathematica syntax and see what kind of translater
could be made.  It would be insufficient, but at least it could do a
fair part of the grunt work of conversion.

> So far as I can tell, no program to date uses XML to convey
> mathematical semantics except by using an internal comment that
> essentially embeds in it the "real meaning"  as, say, a
> character string in the syntax of Maple or Mathematica or MuPad ...,
> and XML is largely superfluous except for its partial information
> to assist in a display on a browser with a variable line-width.
> 
>  I would be interested, in finding a serious counterexample
> to the statement above.

I have none, but the embedding idea might have some merit for file
storage (not program communication.)

> A small program can, I think, parse XML into a lisp form
> (and expand it back to XML). In the lisp form it is probably
> 10 times smaller.  The reason for XML being large is that
> it fits into a schema for verbose markup languages, which
> is hardly an incentive to use it to communicate between two
> math programs.  I would not especially mind it being verbose,
> but it doesn't seem to provide a satisfactory solution to the task
> at hand, at least as far as I can see.

One area where it MIGHT be useful is to define a .maxima file format -
we could define a DTD for our own purposes.  Maybe something like:

<?xml version="1.0"?>
<!DOCTYPE PARTS SYSTEM "maxima.dtd">
<maximadocument>
<group>

   <comment>
   [Paragraph explaining the next step]
   </comment>

   <input>
   [maxima expression, 2D input, etc.]
   </input>

   <output>
   [markup output, maxima expression, etc.]
   </output>

   <input>
   [plot command]
   </input>
   
   <output>
     <plot>
       [plotting environment specific commands]
     </plot>
   </output>

</group>
</maximadocument>

Verbose, but it really doesn't matter given the size of today's hard
drives.  Also we could add a compression routine as part of the save if
we wanted - the idea would be that a human could decompress this and
read it easily at need. It would be merely a storage mechanism, not a
communication method between programs, and wouldn't itself try to be
smart about the mathematical formats.  One arguement in favor of
something like this is that there are standard libraries out there for
parsing XML in lots of languages, and various interface programs could
easily handle the universal file format.  If an interface couldn't
handle some element made for a fancier interface, it could just ignore
it and no harm done.  If, say, on the terminal the comment tag doesn't
mean anything, it can be skipped, and the group tag can just be ignored
since the terminal doesn't have any graphical grouping abilities. 
Someone more knowledgable about how XML works should tell us what it
can do, but defining our equilavent to a .doc file or .mma file is
where I can see a use for XML.

I think there are some XML tools for lisp somewhere, but I have no
experience with them or what they can do.  I don't know if this idea
appeals to anyone, or even really makes sense, so someone who knows
more  should comment.

CY

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/