Interface to Mathics

182 views
Skip to first unread message

seb....@gmail.com

unread,
May 5, 2021, 9:17:45 AM5/5/21
to sage-devel

Dear all,

those who participated in the Sage Days 110  may remember a talk about Mathics.
This is an open source interpreter for the Wolfram Language. I think it would be a good enhancement for Sage to have an interface to it. This would enable
people (like me) that don't have access to a system possessing a Mathematica licence to use functionality being written in WL inside Sage.

I already wrote some code to start up the realization of such an interface in #31778.

Any contribution to this is welcome!

Especially, I would appreciate if people that have more experiences with this kind of interfaces than I do (which is almost nothing) could have a look at the code!

Best
Sebastian

seb....@gmail.com

unread,
Sep 7, 2021, 6:16:50 AM9/7/21
to sage-devel
This is ready for review, now!

William Stein

unread,
Sep 7, 2021, 3:48:17 PM9/7/21
to sage-devel
Question: I didn't go to that talk, and I wasn't able to find slides
or video. I looked on Github and it appears that Mathics has seen a
flurry of development activity during the last year (yeah!!). Is
there a 1-minute summary of the status of where it's at as a project?

-- William
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/ba4034af-7ad2-492a-83ea-ae068912f9c7n%40googlegroups.com.



--
William (http://wstein.org)

seb....@gmail.com

unread,
Sep 8, 2021, 3:18:57 AM9/8/21
to sage-devel
I don't know anything shorter than their release notes. Therefore, I forwarded your question to Rocky Bernstein.

At least Mathics covers all of the functionality touched by our doctests of the Mathematica interface, except one function (FindMinimum). On the other hand, my impression is that there is still a lot of work to do until you can read in larger Mathematica packages and they just work.

Rocky Bernstein

unread,
Sep 9, 2021, 7:17:36 AM9/9/21
to sage-devel
In the past year we have: 

  • Upgraded all packages and libraries that Mathics depends on 
  • Broken up what was one single repository into several git repositories and installable Python libraries/packages 
  • Expanded and strengthened each of these components
  • Added about 150 Mathematica Built-in Functions, and enhanced or fixed bugs in about 60 existing Built-in Functions
  • Expanded and Improved interactive online and printed documentation
  • Added a package for Networks and Graphs via networkx
  • Greatly expanded the command-line utility
  • Provide an up-to-date docker images for major releases which contains all of the components and add-ons, and even the most recent LaTeX PDF (with a program to read it)
  • Fixed numerous bugs and enhanced performance

This is the one minute summary. However in my opinion this doesn't do justice to the huge amount of work behind some of these. So if you have more than a minute here
is an elaboration of some of the bullet items above: 

Updated versions of software:

  • Python: from 2.7 to 3.x up to 3.9
  • Django from 1.6 .10 to 3.2.6
  • MathJax 2.0 to 2.7.9
  • three.js  r49 to r132
  • mpmath 0.17  to 1.2.1
  • Sympy 0.7.3 to 1.8 

Significant split-off or new packages/repositories: 

It is hoped that a number of the above can and will be used outside of Mathics. Those of note are the Mathematica tables and scanner mathics-scanner, the Graphics3D implementation in three.js, mathics-threejs-backend, and the syntax highlighter mathics-pygments. In fact, Symja which is interesting of its own right, uses or consults some of these. 

And here, I should also mention that we are always looking for ways to collaborate with Sage or other open-source projects. 

Although what we have now is pretty impressive (and I am amazed we have gotten this far), we should not give the impression that Mathics is anywhere complete.  

Here is what we are working on and what I hope to see accomplished over the next year: 
  • Speeding up performance in the Mathics interpreter - we are working on this right now. 
  • FindMinimum - it was started but is not complete
  • Speeding up loading time - this is harder and can only come after the above
  • Being able to run more large Mathematica packages out of the box. Right now we can handle Steven Skiena's Combinatorica v0.9.  We would like to see, Rubi and KnotTheory at least added to this. If you have suggestions and are willing to help out contact us. Right now we are finding the performance the biggest obstacle here.
  • Setting up some sort of registry of Mathematica packages that work on Mathics
  • Supporting Backward compatibility of older Mathematica versions
  • Jupyter integration. Right now the main obstacle is cleaning up the API interaction between Mathics core and front ends 
We could use lots of help in just about every aspect. Please help out! If you are not a Python programmer, that's okay. Here are some areas outside of Python programming where you could help:

  • Mathematica Programmers: Add missing Built in Function or functions which bridge compatibility between  Mathematica versions
  • Mathematicians:  Make our online and printed documentation more usable and informative. Find better examples for the functions, or describe the functions better. 
  • Literary types: Write or adapt your Mathematica Tutorial. As above, improve our user (or developer) documentation 
  • Asymptote and LaTeX gurus: our Asymptote library especially needs work.
And of course if you are a Python programmer, especially with a facility for Sympy, numpy, mpmath or Scipy, please join us.

Last, and most important, I would like to mention and offer great thanks to those who have been a part of the Mathics team which has done all of the things above. Without these people we would have been stuck back a decade ago in 2011. 

Special thanks to: 

  • Mauricio Matera  - he knows the most about the current system, the Wolfram Language and Mathematica. He has written most of the new Built-in Functions too
  • Tiago Cavalcante Trindade - he started the mathics-threejs-backend and has gotten us a decade further in three.js has modernized most of the Django code. He is also a performance guru so the graphics speedups in rendering 3D objects is all due to him. 
  • Pablo Emilio Escobar Gaviria  - he started the Mathematica Symbol Tables (mathics-scanner) moved us forward in Django and has a great general knowledge of the system.
A full list of people who have contributed can be found here

William Stein

unread,
Sep 9, 2021, 12:02:26 PM9/9/21
to sage-devel
Wow, that's a fantastic email and great work that you're doing!

If you haven't already, maybe you could turn this email into a
"Status" link on the mathics website, since it's really good.

-- William
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/5f877e0e-a15c-445a-99fc-d82e3c8adae3n%40googlegroups.com.



--
William (http://wstein.org)

Rocky Bernstein

unread,
Sep 9, 2021, 1:08:54 PM9/9/21
to sage-devel

Thanks for the kind words and feedback. I'll add a section for Status over the weekend.

We've been mostly crisis driven, so when it comes to stuff like this it just hasn't bubbled up. Also needed are updated screenshots and animated GIFs - things  often look a little better than what's currently shown there. 
Reply all
Reply to author
Forward
0 new messages