MathICS: A free, light-weight (online) alternative to Mathematica with support for Sage

1,335 views
Skip to first unread message

Jason Grout

unread,
Mar 31, 2012, 11:36:38 AM3/31/12
to sage-...@googlegroups.com
I just ran across this project, which provides an online CAS with
Mathematica syntax, but says they use sympy and Sage as backends:

http://www.mathics.org/

Try the demo here:

http://www.mathics.net/ (click on the "demo" down at the bottom to see
some examples)

Does anyone know these people?

Thanks,

Jason

John Cremona

unread,
Mar 31, 2012, 11:41:45 AM3/31/12
to sage-...@googlegroups.com

It's a one-man show: http://www.poeschko.com/

Perhaps someone should email him and ask why he doesn't just join Sage ?

John

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

Daniel Krenn

unread,
Mar 31, 2012, 12:04:58 PM3/31/12
to sage-...@googlegroups.com, Jan Pöschko
Am 2012-03-31 17:41, schrieb John Cremona:
> On 31 March 2012 16:36, Jason Grout <jason...@creativetrax.com> wrote:
>> I just ran across this project, which provides an online CAS with
>> Mathematica syntax, but says they use sympy and Sage as backends:
>>
>> http://www.mathics.org/
>>
>> Try the demo here:
>>
>> http://www.mathics.net/ (click on the "demo" down at the bottom to see some
>> examples)
>>
>> Does anyone know these people?
>
> It's a one-man show: http://www.poeschko.com/
>
> Perhaps someone should email him and ask why he doesn't just join Sage ?

I know him. He will apply for GSoC2012.

Daniel

Daniel Krenn

unread,
Mar 31, 2012, 12:18:49 PM3/31/12
to sage-...@googlegroups.com, Jan Pöschko
Am 2012-03-31 18:04, schrieb Daniel Krenn:
> Am 2012-03-31 17:41, schrieb John Cremona:
>> On 31 March 2012 16:36, Jason Grout <jason...@creativetrax.com> wrote:
>>> http://www.mathics.org/
>>> [...]

>>> Does anyone know these people?
>> Perhaps someone should email him and ask why he doesn't just join Sage ?
> I know him. He will apply for GSoC2012.

And I've CCed this thread to him. Maybe he can tell us something about
his plans for Mathics...

Daniel

leif

unread,
Mar 31, 2012, 12:44:30 PM3/31/12
to sage-devel
On 31 Mrz., 18:18, Daniel Krenn <kr...@aon.at> wrote:
> Am 2012-03-31 18:04, schrieb Daniel Krenn:
>
> > Am 2012-03-31 17:41, schrieb John Cremona:
> >> On 31 March 2012 16:36, Jason Grout <jason-s...@creativetrax.com> wrote:
> >>>http://www.mathics.org/
> >>> [...]
> >>> Does anyone know these people?
> >> Perhaps someone should email him and ask why he doesn't just join Sage ?
> > I know him. He will apply for GSoC2012.
>
> And I've CCed this thread to him. Maybe he can tell us something about
> his plans for Mathics...

"Please support Mathics by giving something via Flattr!

WANTED: Developers! Please contact me at mail(at)mathics.org or via
Twitter if you want to be part of this awesome project!"

:-)


-leif

Maarten Derickx

unread,
Mar 31, 2012, 1:08:16 PM3/31/12
to sage-...@googlegroups.com
I at least know that the creator of that project has a sage trac account.

leif

unread,
Mar 31, 2012, 1:17:09 PM3/31/12
to sage-devel
FWIW, since he's cc'ed to this thread:

The installation instructions [1] for the optional Sage support won't
work with Sage 5.x:

sage -sh
sage -python setup.py install
python install_sage_scripts.py
rm $SAGE_ROOT/local/lib/python2.6/site-packages/setuptools-*.egg

More generic:

sage --python setup.py install
sage --python install_sage_scripts.py
sage --sh -c 'rm "$SAGE_ROOT"/local/lib/python/site-packages/
setuptools-*.egg'

(Untested. '.../local/lib/python' is a symbolic link to Sage's
current version, i.e. 'python2.6/' for Sage 4.x, 'python2.7/' for Sage
5.x.)

And this of course requires 'sage' to be in your PATH. Otherwise,
also from the Mathics directory:

/path/to/sage_installation/sage --sh
python setup.py install
python install_sage_scripts.py
rm "$SAGE_ROOT"/local/lib/python/site-packages/setuptools-*.egg
exit # leave Sage subshell


-leif

[1] http://www.mathics.org/ -- click "Show instructions", there's no
anchor

kcrisman

unread,
Mar 31, 2012, 2:11:23 PM3/31/12
to sage-devel
Granted that it seems to use a lot of Sympy and has a much more Mma-
like syntax, I can see a definite niche for this. The server
currently works fine. Why it isn't called something that makes its
connection with Sympy clearer? I see a lot about Sage, but not too
much about Sympy or mpmath. Maybe it should try to get more closely
connected to the scientific Python community, with a different
language for those familiar with Mma.

"There is already a well-established free computer algebra system:
Sage. It is really powerful and has a growing, active community behind
it. Yet, by design, it will always be bound to Python syntax and
therefore lack the “structural beauty” of the Mathematica® language.
Mathics aims at combining the best of both worlds: the beauty of
Mathematica® backed by a free, extensible Python core, with potential
to integrate all desired Sage functionality."

Volker Braun

unread,
Mar 31, 2012, 4:13:44 PM3/31/12
to sage-...@googlegroups.com
On Saturday, March 31, 2012 7:11:23 PM UTC+1, kcrisman wrote: 
therefore lack the “structural beauty” of the Mathematica® language.

Well-placed irony quotation marks!

leif

unread,
Mar 31, 2012, 4:35:32 PM3/31/12
to sage-devel
:-)

"The core of Mathics is and shall remain independent of Sage, as it
adds a huge footprint to the installation and Mathics should remain
rather lightweight. In addition, it should be easier to install
Mathics on Windows and mobile platforms where Sage is not available.
That's why the light-weight SymPy Python package is prefered for
advanced calculations, like integration, that will not be implemented
in Mathics itself."

Subject to change [Windows and mobile platforms]... (?)


Not sure about the "huge footprint" of a (standard) Sage
installation. Removing f2c, MoinMoin, bitmap fonts, Fortran binaries;
adding GCC... ;-)


-leif

William Stein

unread,
Mar 31, 2012, 5:01:57 PM3/31/12
to sage-...@googlegroups.com
On Sat, Mar 31, 2012 at 9:35 PM, leif <not.r...@online.de> wrote:
> On 31 Mrz., 22:13, Volker Braun <vbraun.n...@gmail.com> wrote:
>> On Saturday, March 31, 2012 7:11:23 PM UTC+1, kcrisman wrote:
>>
>> > therefore lack the “structural beauty” of the Mathematica® language.
>>
>> Well-placed irony quotation marks!
>
> :-)
>
> "The core of Mathics is and shall remain independent of Sage, as it
> adds a huge footprint to the installation and Mathics should remain
> rather lightweight. In addition, it should be easier to install
> Mathics on Windows and mobile platforms where Sage is not available.
> That's why the light-weight SymPy Python package is prefered for
> advanced calculations, like integration, that will not be implemented
> in Mathics itself."
>
> Subject to change [Windows and mobile platforms]... (?)

This is pretty nice.

I used it for some basic mathematica-like stuff, and it seemed to work
fine. I did try an integral though:

Integrate[Sin[x]*Cos[x+1],x]

and I seem to be able to count to 10 before getting the answer, even
if I retry it several times in the session. That
seems surprisingly slow, given:

sage: time integrate(sin(x)*cos(x+1), x)
-1/2*x*sin(1) - 1/4*cos(2*x + 1)
Time: CPU 0.01 s, Wall: 0.01 s
sage: time integrate(sin(x)*cos(x+1), x, algorithm='sympy')
-1/2*x*sin(x + 1)*cos(x) + 1/2*x*sin(x)*cos(x + 1) + 1/2*sin(x + 1)*sin(x)
Time: CPU 0.53 s, Wall: 0.53 s

I do realize sympy is way slower than maxima at this, but still it's
much faster than the website. I wonder what happens behind the scenes
to make that slow... The very first time I tried it in sympy it was
much slower due to imports (on my very slow disk):

sage: time integrate(sin(x)*cos(x+1), x, algorithm='sympy') # first
time only...
-1/2*x*sin(x + 1)*cos(x) + 1/2*x*sin(x)*cos(x + 1) + 1/2*sin(x + 1)*sin(x)
Time: CPU 1.29 s, Wall: 15.64 s

>
>
> Not sure about the "huge footprint" of a (standard) Sage
> installation.  Removing f2c, MoinMoin, bitmap fonts, Fortran binaries;
> adding GCC... ;-)
>
>
> -leif
>

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

--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

Dr. David Kirkby

unread,
Apr 1, 2012, 6:08:14 PM4/1/12
to sage-...@googlegroups.com
On 03/31/12 09:13 PM, Volker Braun wrote:
> On Saturday, March 31, 2012 7:11:23 PM UTC+1, kcrisman wrote:
>>
>> therefore lack the �structural beauty� of the Mathematica� language.
>
>
> Well-placed irony quotation marks!
>


I'm not convinced of the "structural beauty" of Mathematica, but I can see a lot
of advantages of accepting a Mathematica syntax. Mathematica is much more
consistent than Sage. Since Sage often has various packages which can do what
you want, you often need to specify what one, which is fine if you know of them.
But Mathematica seems simpler in some respects, though I still find the syntax
quite daunting.

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

Dr. David Kirkby

unread,
Apr 1, 2012, 6:15:28 PM4/1/12
to sage-...@googlegroups.com
On 03/31/12 10:01 PM, William Stein wrote:

> This is pretty nice.
>
> I used it for some basic mathematica-like stuff, and it seemed to work
> fine. I did try an integral though:
>
> Integrate[Sin[x]*Cos[x+1],x]
>
> and I seem to be able to count to 10 before getting the answer, even
> if I retry it several times in the session. That
> seems surprisingly slow, given:


Perhaps the server was under a lot of load at the time. I just tried the same
and got an almost instant answer.

Timing[Integrate[Sin[x]*Cos[x+1],x]]

gave the time as 0.52 seconds.

That said, 0.52 seconds is almost 100x slower than Mathematica running on my Sun.

In[2]:= Timing[Integrate[Sin[x]*Cos[x+1],x]]

-Cos[1 + 2 x] x Sin[1]
Out[2]= {0.004724, ------------- - --------}
4 2

The output from MathICS is also in a more complicated form (more terms) than the
output from Mathematica.

Dave

rjf

unread,
Apr 2, 2012, 10:01:58 AM4/2/12
to sage-devel
I doubt that he means it to be ironic.


RJF

John Cremona

unread,
Apr 2, 2012, 12:18:10 PM4/2/12
to sage-...@googlegroups.com
I noticed that Mithic is listed here:
http://www.mathjax.org/community/mathjax-in-use/ so perhaps Sage
should be also.

John

Jan Pöschko

unread,
Apr 2, 2012, 12:32:33 PM4/2/12
to sage-...@googlegroups.com
Hi everybody,

I'm the creator and only maintainer of Mathics. It's great to see some discussion of Mathics here, and I'll happily join it...

On Saturday, March 31, 2012 5:41:45 PM UTC+2, John Cremona wrote:

Perhaps someone should email him and ask why he doesn't just join Sage ?

What do you mean by "join" and what do you think would be the benefits of it?

So far, the biggest challenges in the development of Mathics were (1) parsing Mathematica syntax, (2) doing Mathematica-like evaluation of expressions (pattern matching, rules, etc.), (3) mimicking the way Mathematica formats (and lets the user format) expressions, (4) providing a Mathematica-like Web interface. At least when I started working on Mathics, I couldn't see how Sage could've helped me with (1), (2), and (3). I can see that I could have used sage-notebook for (4), but I still reckoned it would have been more work to adapt it than to create something independent. (Reinventing the wheel seems so appealing when you're young... ;))

One of the biggest arguments against building everything on top of Sage has always been the size and all the dependencies of Sage, as already mentioned in the docs and in this thread. I'm really not a fan of Windows, but I didn't want to discard the possibility of providing Mathics for Windows at the very beginning, when (obviously) not really necessary. But maybe this argument isn't even valid anymore.

From my perspective, it makes sense to keep the core of Mathics light-weight and independent of Sage, but use Sage as a big optional library (of libraries) to provide extra mathematical functionality. Still, Mathics could be a part of Sage that provides a very Mathematica-like environment inside Sage while still retaining its core independence, at least as long as it's reasonable (is that what you mean by "join"?); actually, I love this idea and would be open for discussions.

If by "join" you rather mean me personally working on Sage: As Daniel mentioned, I'll apply for GSoC, so I definitely would like to do that, although the current project idea (lattices) is not related to Mathics.

Jan

kcrisman

unread,
Apr 2, 2012, 12:40:38 PM4/2/12
to sage-devel

> From my perspective, it makes sense to keep the core of Mathics
> light-weight and independent of Sage, but use Sage as a big optional
> library (of libraries) to provide extra mathematical functionality. Still,
> Mathics could be a part of Sage that provides a very Mathematica-like
> environment inside Sage while still retaining its core independence, at
> least as long as it's reasonable (is that what you mean by "join"?);
> actually, I love this idea and would be open for discussions.

Maybe a "Mathics" optional spkg, sort of like the new Sage Cell server
optional spkg? Then Sage would be an optional part of Mathics and
vice versa. I wonder if the Sympy folks would also be interested in a
"Mathics mode" or something...

- kcrisman

Jan Pöschko

unread,
Apr 2, 2012, 12:42:01 PM4/2/12
to sage-...@googlegroups.com, Jan Pöschko
On Saturday, March 31, 2012 6:18:49 PM UTC+2, Daniel Krenn wrote:
Maybe he can tell us something about

his plans for Mathics...

I have a lot of ideas for future features of Mathics. One (rather ambitious one) would be to (automatically) translate all of its Python code base to JavaScript and have it executed on the client side. If combined with a Google-Docs-like interface for collaboration, this could even be used to allow "instantaneous" distributed computing. I doubt having all of Sage in JavaScript will ever be possible – what do you think?

On the other hand, using Sage to provide much broader mathematical functionality in Mathics is definitely on my to-do list. And, as mentioned earlier, integrating Mathics "back" into Sage would also appeal to me.

I never had the intention of making Mathics a fully integrated CAS. I never wanted to reinvent all the mathematical functionality that's already out there, which is why I used SymPy and Sage for the mathematically "heavy" stuff.

Summing up, I see Mathics as a light-weight front-end providing Mathematica-like syntax and look-and-feel – please don't sue me, Wolfram – using existing CAS as back-ends for doing the actual mathematical computations. Thereby, it's both a use case and (more theoretically) an alternative to Sage; which probably makes it a potential part of Sage, the beautiful unification of all alternatives. ;)

Jan Pöschko

unread,
Apr 2, 2012, 12:42:23 PM4/2/12
to sage-...@googlegroups.com
On Saturday, March 31, 2012 6:44:30 PM UTC+2, leif wrote:

"Please support Mathics by giving something via Flattr!

WANTED: Developers! Please contact me at mail(at)mathics.org or via
Twitter if you want to be part of this awesome project!"

:-)

 Well, at least it made you laugh. :)

Jan 

Jan Pöschko

unread,
Apr 2, 2012, 12:42:43 PM4/2/12
to sage-...@googlegroups.com
Thank you for these insights! I'll have a look at the installation with Sage 5.x. Will your instructions also work with Sage 4.y?

Jan Pöschko

unread,
Apr 2, 2012, 12:43:42 PM4/2/12
to sage-...@googlegroups.com
On Saturday, March 31, 2012 8:11:23 PM UTC+2, kcrisman wrote:
Granted that it seems to use a lot of Sympy and has a much more Mma-
like syntax, I can see a definite niche for this.  The server
currently works fine.

Great! :)
 
Why it isn't called something that makes its
connection with Sympy clearer?  I see a lot about Sage, but not too
much about Sympy or mpmath.

You're probably right that it would be fair to mention them more prominently. The reason why I put Sage in the subtitle is probably more of an advertising one: ;) It shows that there is a lot of potential w.r.t. functionality in Mathics.
 
Maybe it should try to get more closely
connected to the scientific Python community, with a different
language for those familiar with Mma.

You're totally right.
 

"There is already a well-established free computer algebra system:
Sage. It is really powerful and has a growing, active community behind
it. Yet, by design, it will always be bound to Python syntax and
therefore lack the “structural beauty” of the Mathematica® language.
Mathics aims at combining the best of both worlds: the beauty of
Mathematica® backed by a free, extensible Python core, with potential
to integrate all desired Sage functionality."

Still valid IMHO, though this doesn't imply Mathics shouldn't be part of Sage. 

Jan Pöschko

unread,
Apr 2, 2012, 12:44:11 PM4/2/12
to sage-...@googlegroups.com
On Saturday, March 31, 2012 10:35:32 PM UTC+2, leif wrote:

"The core of Mathics is and shall remain independent of Sage, as it
adds a huge footprint to the installation and Mathics should remain
rather lightweight. In addition, it should be easier to install
Mathics on Windows and mobile platforms where Sage is not available.
That's why the light-weight SymPy Python package is prefered for
advanced calculations, like integration, that will not be implemented
in Mathics itself."

Subject to change [Windows and mobile platforms]... (?)


Not sure about the "huge footprint" of a (standard) Sage
installation.  Removing f2c, MoinMoin, bitmap fonts, Fortran binaries;
adding GCC... ;-)


I might still reconsider my decision about a much tighter integration of Sage and Mathics...

Jan Pöschko

unread,
Apr 2, 2012, 12:45:56 PM4/2/12
to sage-...@googlegroups.com
On Saturday, March 31, 2012 11:01:57 PM UTC+2, William wrote:

This is pretty nice.


I'm really glad you like it.
 

I used it for some basic mathematica-like stuff, and it seemed to work
fine.  I did try an integral though:

  Integrate[Sin[x]*Cos[x+1],x]

and I seem to be able to count to 10 before getting the answer, even
if I retry it several times in the session.  That
seems surprisingly slow, given:

sage: time integrate(sin(x)*cos(x+1), x)
-1/2*x*sin(1) - 1/4*cos(2*x + 1)
Time: CPU 0.01 s, Wall: 0.01 s
sage: time integrate(sin(x)*cos(x+1), x, algorithm='sympy')
-1/2*x*sin(x + 1)*cos(x) + 1/2*x*sin(x)*cos(x + 1) + 1/2*sin(x + 1)*sin(x)
Time: CPU 0.53 s, Wall: 0.53 s

I do realize sympy is way slower than maxima at this, but still it's
much faster than the website.  I wonder what happens behind the scenes
to make that slow...  

There's really not much overhead in Integrate over SymPy's integration. Some problems on my web server caused the slow queries. By the way, you can use SageIntegrate (instead of Integrate) to use Sage (i.e. Maxima) as a back-end (instead of SymPy); this is faster and gives better results.

Jan Pöschko

unread,
Apr 2, 2012, 12:47:05 PM4/2/12
to sage-...@googlegroups.com
On Monday, April 2, 2012 12:15:28 AM UTC+2, Dr. David Kirkby wrote:
On 03/31/12 10:01 PM, William Stein wrote:

> That
> seems surprisingly slow, given:


Perhaps the server was under a lot of load at the time. I just tried the same
and got an almost instant answer.

You're right, every now and then the server gets stuck with some "nasty" calculations. I probably shouldn't say this out loud, but the security model of Mathics isn't very evolved yet, so a troublesome query might lead to endless CPU and even memory usage. There are some checks, but there's still work to do.
 

Timing[Integrate[Sin[x]*Cos[x+1],x]]

gave the time as 0.52 seconds.

That said, 0.52 seconds is almost 100x slower than Mathematica running on my Sun.

In[2]:= Timing[Integrate[Sin[x]*Cos[x+1],x]]

                    -Cos[1 + 2 x]   x Sin[1]
Out[2]= {0.004724, ------------- - --------}
                          4            2

The output from MathICS is also in a more complicated form (more terms) than the
output from Mathematica.

Integration is one of the functions where Sage can already be used as a back-end instead of SymPy: SageIntegrate[Sin[x]*Cos[x+1],x] runs faster and gives a more compact result.

I'm still thinking about a better way to choose Sage for integration (etc). One would be to introduce a Sage "package" that overrides all corresponding SymPy-enabled functions; this would require the implementation of Mathematica-like packages first, of course. Another way would be to have an option
Engine->Sage
for Integrate, for instance, which is probably still more Mathematica-like than a totally different function (symbol) SageIntegrate.

Jan Pöschko

unread,
Apr 2, 2012, 12:49:45 PM4/2/12
to sage-...@googlegroups.com
I really don't want to start a Mathematica vs Sage (or Python) discussion here. Actually, I didn't mean "structural beauty" ironically, but probably somewhat differently than you think: I was thinking about the (tree-like) structure in which expressions are represented in Mathematica and the general beauty of functional programming languages. (Of course I know Python can be used in functional ways, too, but would you agree that Mathematica has a more functional spirit, as a whole? With all its flaws, that is.)

Disclaimer: I love Sage and Mathematica.

Jan Pöschko

unread,
Apr 2, 2012, 12:50:36 PM4/2/12
to sage-...@googlegroups.com
On Saturday, March 31, 2012 7:08:16 PM UTC+2, Maarten Derickx wrote:
I at least know that the creator of that project has a sage trac account.

That's true, I used it to file http://trac.sagemath.org/sage_trac/ticket/10914 once. I hope to use it much more extensively in the near future...

Jan

Jason Grout

unread,
Apr 2, 2012, 1:25:02 PM4/2/12
to sage-...@googlegroups.com
On 4/2/12 11:49 AM, Jan P�schko wrote:
> On Monday, April 2, 2012 4:01:58 PM UTC+2, rjf wrote:
>
>
>
> On Mar 31, 1:13 pm, Volker Braun <vbraun.n...@gmail.com> wrote:
> > On Saturday, March 31, 2012 7:11:23 PM UTC+1, kcrisman wrote:
> >
> > > therefore lack the �structural beauty� of the Mathematica�
> language.
> >
> > Well-placed irony quotation marks!
>
> I doubt that he means it to be ironic.
>
>
> I really don't want to start a Mathematica vs Sage (or Python)
> discussion here. Actually, I didn't mean "structural beauty" ironically,
> but probably somewhat differently than you think: I was thinking about
> the (tree-like) structure in which expressions are represented in
> Mathematica and the general beauty of functional programming languages.
> (Of course I know Python can be used in functional ways, too, but would
> you agree that Mathematica has a more functional spirit, as a whole?
> With all its flaws, that is.)
>
> Disclaimer: I love Sage /and/ Mathematica.

+1. I used MMA a lot before Sage, and the consistency of the MMA
language and the simple lisp-like form of its expressions were things
that I missed a lot.

Jason

Jason Grout

unread,
Apr 2, 2012, 1:32:50 PM4/2/12
to sage-...@googlegroups.com
On 4/2/12 11:42 AM, Jan P�schko wrote:
> On Saturday, March 31, 2012 6:18:49 PM UTC+2, Daniel Krenn wrote:
>
> Maybe he can tell us something about
>
> his plans for Mathics...
>
> I have a lot of ideas for future features of Mathics. One (rather
> ambitious one) would be to (automatically) translate all of its Python
> code base to JavaScript and have it executed on the client side. If
> combined with a Google-Docs-like interface for collaboration, this could
> even be used to allow "instantaneous" distributed computing. I doubt
> having all of Sage in JavaScript will ever be possible � what do you think?

I have been thinking about such a thing lately too (and was going to
post about it when I saw Bill's joke about FLINT3 in javascript). I
think there would be some very good uses for a simple SR->javascript
compiler. For example, we could have truly dynamic graphs all in the
browser client. Imagine doing:

var('a')
plot(sin(a*x), (x,0,1))

and having a javascript graph pop up with a slider for a. Or

var('a')
@interact
def _(a=(0,1)):
interactive_plot(sin(a*x), (x,0,1))

and having the interact slider directly control a javascript plot of
sin(ax). We could do that if we can translate sin(a*x) into a
javascript function, then send that javascript function to the browser.


>
> On the other hand, using Sage to provide much broader mathematical
> functionality in Mathics is definitely on my to-do list. And, as
> mentioned earlier, integrating Mathics "back" into Sage would also
> appeal to me.
>
> I never had the intention of making Mathics a fully integrated CAS. I
> never wanted to reinvent all the mathematical functionality that's
> already out there, which is why I used SymPy and Sage for the
> mathematically "heavy" stuff.
>
> Summing up, I see Mathics as a light-weight front-end providing

> Mathematica-like syntax and look-and-feel � please don't sue me, Wolfram
> � using existing CAS as back-ends for doing the actual mathematical


> computations. Thereby, it's both a use case and (more theoretically) an
> alternative to Sage; which probably makes it a potential part of Sage,
> the beautiful unification of all alternatives. ;)


I see another use: we have a very simple MMA<->Sage translator we use to
implement the mathematica() command. You have a much more sophisticated
translator.

I also see it being very useful for people learning Sage from MMA. They
can enter MMA notation, and see the corresponding python/Sage notation.

The "don't sue me" part worries me a little. If I understand things
correctly, Wolfram has been known to sue people. Richard Fateman has
implemented a product that uses the MMA notation---perhaps he can
enlighten us as to the probability of being sued and what we need to be
careful of? (I'm asking him as an experienced person, not as a lawyer,
of course).

Thanks,

Jason


Dr. David Kirkby

unread,
Apr 2, 2012, 2:30:53 PM4/2/12
to sage-...@googlegroups.com
On 04/ 2/12 05:47 PM, Jan P�schko wrote:

> I'm still thinking about a better way to choose Sage for integration (etc).
> One would be to introduce a Sage "package" that overrides all corresponding
> SymPy-enabled functions; this would require the implementation of
> Mathematica-like packages first, of course. Another way would be to have an
> option
> Engine->Sage
> for Integrate, for instance, which is probably still more Mathematica-like
> than a totally different function (symbol) SageIntegrate.
>

It's your project, but if it was me, I'd certainly go for the Engine->Sage
approach, which as you say it more Mathematica-like.

I've not looked at your program, but how did you write the parser? Do you
convert expressions to FullForm, so 1+2 is represented by

Plus[1,2]

or do you use some other method?

You might run into the same problem Richard Fateman run into, with Wolfram
Research threatening legal action over the use of their commands. If so, I'd
remind them of the famous Borland vs Lotus case

http://en.wikipedia.org/wiki/Lotus_Dev._Corp._v._Borland_Int%27l,_Inc.

which was settled in the Supreme Court in the USA.

Volker Braun

unread,
Apr 2, 2012, 3:43:38 PM4/2/12
to sage-...@googlegroups.com
You can always be sued and be forced to spend a lot of time and money on your defense, regardless of whether you are innocent or guilty.

While there is no reasonable doubt that computer languages can't be copyrighted, Wolfram can always use some software patent to drag anybody to court. How about #20110004864, or "Method of Dynamically Linking Objects Operated on by a Computational System". How can you write any computational system without linking objects operated on? Could it possibly be more vague? I'm pretty sure that one could find prior art here and have such a patent suit be thrown out after spending a few years in court, but it will cost you dearly...

To Wolfram's defense, they haven't abused the court system. But its naive to think that you can't be sued (for any reason).



On Monday, April 2, 2012 7:30:53 PM UTC+1, Dr. David Kirkby wrote:

Jason Grout

unread,
Apr 2, 2012, 1:39:53 PM4/2/12
to sage-...@googlegroups.com
On 4/2/12 11:18 AM, John Cremona wrote:
> I noticed that Mithic is listed here:
> http://www.mathjax.org/community/mathjax-in-use/ so perhaps Sage
> should be also.
>

Except that Sage doesn't use MathJax yet...

First, the new notebook needs to be merged. Then upgrading jsmath to
mathjax is trac ticket http://trac.sagemath.org/sage_trac/ticket/9774
(and pull request https://github.com/sagemath/sagenb/pull/30)

Perhaps the Sage cell server (which does use MathJax) could be listed on
the MathJax webpage.

Thanks,

Jason

Jan Pöschko

unread,
Apr 2, 2012, 4:10:50 PM4/2/12
to sage-...@googlegroups.com
I am quite aware of the potential risk of being sued, but still I don't know what to do about it. Isn't this a general problem when creating (free) software? The patent you mentioned could easily be applied to Sage as well – so how do you deal with that there?

Should I contact Wolfram and explicitly ask whether they're "okay" with Mathics? Could I trust a "yes" and should I just accept a "no"? Given that I'm not a legal expert and don't have the money to hire one, should I rather take down Mathics completely to avoid any risks?

Jan Pöschko

unread,
Apr 2, 2012, 4:25:37 PM4/2/12
to sage-...@googlegroups.com
On Monday, April 2, 2012 8:30:53 PM UTC+2, Dr. David Kirkby wrote:

It's your project, but if it was me, I'd certainly go for the Engine->Sage
approach, which as you say it more Mathematica-like.

Thanks for your input.
 

I've not looked at your program, but how did you write the parser? Do you
convert expressions to FullForm, so 1+2 is represented by

Plus[1,2]

or do you use some other method?


Yes, basically everything is converted to FullForm. The parser (using spark) constructs a tree consisting of Expressions with heads and children down to Atom instances (Integer, Real, Symbol, String, etc). Then the expression is evaluated and formatted using built-in and user-defined rules. Some rules execute "native" Python code to construct the result (example), others are stored in Mathematica form themselves.

Volker Braun

unread,
Apr 2, 2012, 5:26:18 PM4/2/12
to sage-...@googlegroups.com
For the record, I don't think that there is a real chance of being sued by Wolfram. At least not as long as they don't sell patents to trolls. 

On Monday, April 2, 2012 9:10:50 PM UTC+1, Jan Pöschko wrote:
The patent you mentioned could easily be applied to Sage as well – so how do you deal with that there?

Fortunately that hasn't come up yet. The FSF would probably be interested, for starters. 

William Stein

unread,
Apr 2, 2012, 5:55:25 PM4/2/12
to sage-...@googlegroups.com


On Monday, April 2, 2012, Volker Braun <vbrau...@gmail.com> wrote:
> You can always be sued and be forced to spend a lot of time and money on your defense, regardless of whether you are innocent or guilty.
> While there is no reasonable doubt that computer languages can't be copyrighted, Wolfram can always use some software patent to drag anybody to court. How about #20110004864, or "Method of Dynamically Linking Objects Operated on by a Computational System". How can you write any computational system without linking objects operated on? Could it possibly be more vague? I'm pretty sure that one could find prior art here and have such a patent suit be thrown out after spending a few years in court, but it will cost you dearly...
> To Wolfram's defense, they haven't abused the court system. But its naive to think that you can't be sued (for any reason).
>

I have heard of at least one specific instance in which Wolfram did significantly abuse the court system...

Florent Hivert

unread,
Apr 2, 2012, 6:41:26 PM4/2/12
to sage-...@googlegroups.com
> I have heard of at least one specific instance in which Wolfram did
> significantly abuse the court system...

Are you refering to the following issues ?

http://yro.slashdot.org/story/09/07/30/2055221/How-Wolfram-Alphas-Copyright-Claims-Could-Change-Software?art_pos=20

http://www.infoworld.com/d/developer-world/how-wolfram-alpha-could-change-software-248?page=0,0

Cheers,

Florent

David Kirkby

unread,
Apr 2, 2012, 7:05:18 PM4/2/12
to sage-...@googlegroups.com
On 2 April 2012 20:43, Volker Braun <vbrau...@gmail.com> wrote:
> You can always be sued and be forced to spend a lot of time and money on
> your defense, regardless of whether you are innocent or guilty.

True, and they tried it with Richard Fateman, though they have never
successfully stopped Richard distributing the code.


> To Wolfram's defense, they haven't abused the court system. But its naive to
> think that you can't be sued (for any reason).


They have been abuse themselves something I think by CRC

http://en.wikipedia.org/wiki/MathWorld#CRC_lawsuit

David Kirkby

unread,
Apr 2, 2012, 7:32:53 PM4/2/12
to sage-...@googlegroups.com
On 2 April 2012 21:10, Jan Pöschko <jan.po...@gmail.com> wrote:
> I am quite aware of the potential risk of being sued, but still I don't know
> what to do about it. Isn't this a general problem when creating (free)
> software? The patent you mentioned could easily be applied to Sage as well –
> so how do you deal with that there?

Try to get it hosted somewhere like Nigeria.

> Should I contact Wolfram and explicitly ask whether they're "okay" with
> Mathics?

I would not, as you can be sure they would say "no". They tried this
with Richard Fateman, who produced a lisp program which took some
Mathematica input. I'm not sure if Richard wrote back to them, or just
ignored them, but his code is still around.

> Could I trust a "yes" and should I just accept a "no"? Given that
> I'm not a legal expert and don't have the money to hire one, should I rather

> take down Mathily to avoid any risks?

Well, since it's GPL, you could always take it down, and someone else
will get it hosted somewhere like Nigeria. Somehow I don't think they
would bother trying to stop that!

There are many countries where software piracy is very common, and in
such a country Wolfram Research would not waste their time trying to
pursue anyone hosting a web site with your code. They might in the
USA, Europe and a few others places, but there are vast areas of the
world where their lawyers would know they would be wasting their time.

My attitude would be:

1) Host it as you do now.
2) If they moan, point out the Borland/Lotus case, and ask how they
think your situation is materially different from that, which was
settled in the Supreme Court in favor of Borland, who made a clone of
Lotus 123.
3) If they look to get more serious, agree to take it down. Someone
woud bound to get it hosted in a country where WRI would not waste
their time.

Dave

Dan Drake

unread,
Apr 2, 2012, 8:28:38 PM4/2/12
to sage-...@googlegroups.com
On Mon, 02 Apr 2012 at 12:32PM -0500, Jason Grout wrote:
> For example, we could have truly dynamic graphs all in
> the browser client. Imagine doing:
>
> var('a')
> plot(sin(a*x), (x,0,1))
>
> and having a javascript graph pop up with a slider for a. Or
>
> var('a')
> @interact
> def _(a=(0,1)):
> interactive_plot(sin(a*x), (x,0,1))
>
> and having the interact slider directly control a javascript plot of
> sin(ax). We could do that if we can translate sin(a*x) into a
> javascript function, then send that javascript function to the
> browser.

I was just looking at Flot [1] yesterday, and we could definitely do
something like that. We could also look at what GeoGebra is doing with
their HTML5 export stuff, which can (I think) already do something like
your sin(a*x) example.

Dan


References:
[1] https://code.google.com/p/flot/

--
--- Dan Drake
----- http://mathsci.kaist.ac.kr/~drake
-------

signature.asc

William Stein

unread,
Apr 2, 2012, 8:29:20 PM4/2/12
to sage-...@googlegroups.com


On Apr 2, 2012 4:32 PM, "David Kirkby" <david....@onetel.net> wrote:
>
> On 2 April 2012 21:10, Jan Pöschko <jan.po...@gmail.com> wrote:
> > I am quite aware of the potential risk of being sued, but still I don't know
> > what to do about it. Isn't this a general problem when creating (free)
> > software? The patent you mentioned could easily be applied to Sage as well –
> > so how do you deal with that there?
>
> Try to get it hosted somewhere like Nigeria.
>
> > Should I contact Wolfram and explicitly ask whether they're "okay" with
> > Mathics?
>
> I would not, as you can be sure they would say "no". They tried this
> with Richard Fateman, who produced a lisp program which took some
> Mathematica input. I'm not sure if Richard wrote back to them, or just
> ignored them, but his code is still around.
>
> > Could I trust a "yes" and should I just accept a "no"? Given that
> > I'm not a legal expert and don't have the money to hire one, should I rather
> > take down Mathily to avoid any risks?
>
> Well, since it's GPL, you could always take it down, and someone else
> will get it hosted somewhere like Nigeria. Somehow I don't think they
> would bother trying to stop that!

I am also willing to host it on my department server.  My university (uni of washington) has lawyers (=who I have met with in the past and who were very helpful and intelligent.

>
> There are many countries where software piracy is very common, and in
> such a country Wolfram Research would not waste their time trying to
> pursue anyone hosting a web site with your code. They might in the
> USA, Europe and a few others places, but there are vast areas of the
> world where their lawyers would know they would be wasting their time.
>
> My attitude would be:
>
> 1)  Host it as you do now.
> 2) If they moan, point out the Borland/Lotus case, and ask how they
> think your situation is materially different from that, which was
> settled in the Supreme Court in favor of Borland, who made a clone of
> Lotus 123.
> 3) If they look to get more serious, agree to take it down. Someone
> woud bound to get it hosted in a country where WRI would not waste
> their time.
>
> Dave
>

rjf

unread,
Apr 2, 2012, 8:29:45 PM4/2/12
to sage-devel
Hi Jan:

1. I am not a lawyer. If you need legal advice, find a lawyer.

2. I expect that you would be threatened first, rather than sued.
Before you respond at all to any correspondence from WRI, find a
lawyer.

3. I believe a lawyer would advise you that anything you say can
be used against you, even stuff you write here, or any "explanations"
you might be tempted to make.

Arguing legal precedent etc. with a WRI lawyer is not a good idea.
The more you write the worse you make your case.

Lawyers are not judges. They represent their clients. They will not
say to you, "Oh, you are right about Borland".


4. I expect that the status (free / open) of your software is
quite irrelevant to its infringement (or not).

5. Mathics is not the first free Mathematica-compatible parser,
though it looks to be more complete and up-to-date than
MockMMA.

Someone took my MockMMA and released a subset of it as a front-end
to
Maxima. http://mockmma.sourceforge.net/
This sourceforge MockMMA appears to have
is ignored all parts of Mathematica that do not have a direct
translation into Maxima (e.g. pattern-matching!).

This fork appears to be substantially less effective in mimicking
Mathematica than my MockMMA which in turn is less effective
than your Mathics. My MockMMA does not really attempt to do
so much of the internal algorithm stuff, but does bits and pieces
of interest to me at the time. bignums, polynomial
arithmetic, differentiation, some integration. I think your
pattern matching and evaluation is more thorough.


What Mathics could do is call Maxima instead of sympy; right now
if Mathics called Sage, then Sage would call Maxima for some things.

This violates the premise that "the world is python" but of course
that's not my premise.

Probably you (or someone) could bundle Mathics with Maxima on
sourceforge.



> > Should I contact Wolfram and explicitly ask whether they're "okay" with
> > Mathics?
>
> I would not, as you can be sure they would say "no". They tried this
> with Richard Fateman, who produced a lisp program which took some
> Mathematica input.

Um, it also executed it. It was also a Mathematica-syntax front end
to all of Common Lisp, and hence the Mathematica part was, at least
in principle, a small part.


> I'm not sure if Richard wrote back to them, or just
> ignored them, but his code is still around.

They wrote to me first.

I can't think of any scenario in which they would
want to give you, preemptively, permission to go ahead.

Getting free legal advice is worth what you paid for it :(

RJF

Jason Grout

unread,
Apr 2, 2012, 9:05:27 PM4/2/12
to sage-...@googlegroups.com
On 4/2/12 7:28 PM, Dan Drake wrote:
> On Mon, 02 Apr 2012 at 12:32PM -0500, Jason Grout wrote:
>> For example, we could have truly dynamic graphs all in
>> the browser client. Imagine doing:
>>
>> var('a')
>> plot(sin(a*x), (x,0,1))
>>
>> and having a javascript graph pop up with a slider for a. Or
>>
>> var('a')
>> @interact
>> def _(a=(0,1)):
>> interactive_plot(sin(a*x), (x,0,1))
>>
>> and having the interact slider directly control a javascript plot of
>> sin(ax). We could do that if we can translate sin(a*x) into a
>> javascript function, then send that javascript function to the
>> browser.
>
> I was just looking at Flot [1] yesterday, and we could definitely do
> something like that. We could also look at what GeoGebra is doing with
> their HTML5 export stuff, which can (I think) already do something like
> your sin(a*x) example.

Yep, and I've played with jsxgraph doing this sort of thing too.

It's definitely doable, and others are doing it right now. It's just a
matter of getting the design and interface right, then writing the code
(or maybe those two steps should be reversed, or iterated).

Jason

kcrisman

unread,
Apr 2, 2012, 9:20:12 PM4/2/12
to sage-devel
Please please someone who knows how to do this do it... See for
example http://www.sagenb.org/home/pub/285/ and
http://ask.sagemath.org/question/819/a-functional-java-applet-for-2d-plots
and previous discussion of this at https://groups.google.com/forum/#!topic/sage-devel/kcQkzLZw7Us
...

Jason Grout

unread,
Apr 2, 2012, 9:24:27 PM4/2/12
to sage-...@googlegroups.com

Ondřej Čertík

unread,
Apr 10, 2012, 6:04:17 AM4/10/12
to sage-...@googlegroups.com
On Sat, Mar 31, 2012 at 2:01 PM, William Stein <wst...@gmail.com> wrote:

> On Sat, Mar 31, 2012 at 9:35 PM, leif <not.r...@online.de> wrote:
>> On 31 Mrz., 22:13, Volker Braun <vbraun.n...@gmail.com> wrote:
>>> On Saturday, March 31, 2012 7:11:23 PM UTC+1, kcrisman wrote:
>>>
>>> > therefore lack the “structural beauty” of the Mathematica® language.
>>>
>>> Well-placed irony quotation marks!
>>
>> :-)

>>
>> "The core of Mathics is and shall remain independent of Sage, as it
>> adds a huge footprint to the installation and Mathics should remain
>> rather lightweight. In addition, it should be easier to install
>> Mathics on Windows and mobile platforms where Sage is not available.
>> That's why the light-weight SymPy Python package is prefered for
>> advanced calculations, like integration, that will not be implemented
>> in Mathics itself."
>>
>> Subject to change [Windows and mobile platforms]... (?)
>
> This is pretty nice.
>

> I used it for some basic mathematica-like stuff, and it seemed to work
> fine.  I did try an integral though:
>
>  Integrate[Sin[x]*Cos[x+1],x]
>
> and I seem to be able to count to 10 before getting the answer, even
> if I retry it several times in the session.  That
> seems surprisingly slow, given:
>

> sage: time integrate(sin(x)*cos(x+1), x)
> -1/2*x*sin(1) - 1/4*cos(2*x + 1)
> Time: CPU 0.01 s, Wall: 0.01 s
> sage: time integrate(sin(x)*cos(x+1), x, algorithm='sympy')
> -1/2*x*sin(x + 1)*cos(x) + 1/2*x*sin(x)*cos(x + 1) + 1/2*sin(x + 1)*sin(x)
> Time: CPU 0.53 s, Wall: 0.53 s

Indeed, Maxima seems to be really fast on these integrals. Does anyone
know how Maxima does it? Does it use
some special integration algorithm for trigonometric integrals?

Ondrej

Reply all
Reply to author
Forward
0 new messages