Hacker News new | past | comments | ask | show | jobs | submit login
Mathics – A free, light-weight alternative to Mathematica (mathics.github.io)
360 points by dvfjsdhgfv on May 7, 2019 | hide | past | favorite | 83 comments

This needs examples front and center.

Seriously, why is this not more common? When I go to your landing page I want to see how awesome your thing is. A few examples is all it takes.

Show me something like this

In[6]:= Derivative[1][Sin]

Out[6]= Cos[#1]&

In[7]:= Derivative[2][Sin]


Don't make me go to documentation. Also don't compare it to Mathematica if it isn't as intuitive as Mathematica (seriously, it is wildly popular because simple things you don't have to look up. It works like you expect. There was a lot of planning to make it this way. People note the "Zen" of Mathematica). Here's an example of where Mathics is non-intuitive (besides if you remove the [1] from the above example)

n[13]:= x = 5

Out[13]= 5

In[14]:= Derivative[1][x^2]

Out[14]= 25'

In[15]:= f[x] := x^2

In[16]:= Derivative[1][f]

Out[16]= 2 #1&

In[17]:= f'[x]

Out[17]= 10

I know no system is perfect, but try to sell me on your idea before I go through your documentation and get frustrated that it doesn't work like the thing you compare it to.

Thanks for the feedback, the web UI does have a gallery link [0] with a few interactive examples [1]. I agree though, a screenshot like this would be a good addition to the homepage.

[0] https://pasteboard.co/IdIaJNo.png [1] https://pasteboard.co/IdIc7dc.png

I don't think that first image helps but that second image is great. That gets me excited and makes it look intuitive. Seriously, put that on the landing page.

Edit: Also that first example (from [1]) doesn't work for me

In[1]:= 1 + 2 - x * 3 x / y

Out[1]= 3 - 3 x ^ 2 / y

Is this a difference in the cli? I also notice I can't get any graphics there. No connection to matplotlib?

In[3]:= Plot[{Sin[x], Cos[x], Tan[x]}, {x, -3Pi, 3Pi}]

Out[3]= -Graphics-

Thanks a lot for your great work! I installed mathics locally and the translate/sierpinski examples from the gallery don't seem to work. Do you have an idea why?

I ran it on my own linux box. Thanks for this work! Suggestions:

1. host those images some where else than on pastebin, it's too slow to see them on your github page. Try anywhere else. 2. your instructions should tell the exact command to run it after installing it with pip on linux too, like you do on windows.

Somewhat unrelated but I would like to also mention Maxima (http://maxima.sourceforge.net/), which used to be maintained by the late Dr. Schelter and is still updated. Here is a link to an old comparison between it and Mathematica: https://luckytoilet.wordpress.com/2014/08/11/beginners-compa... .

It could be related though Fateman's latest Mockmma, linked from https://people.eecs.berkeley.edu/~fateman/. (He got a legal threat from Wolfram over the original version long ago.)

Other free general symbolic algebra systems are available, of course, like the venerable Reduce and Axiom.

I used to use mockmma a lot as an undergraduate, because it started much faster than mathematica and it could run exactly the same programs. I wonder why mathics does not keep exact compatibility of the language.

Fateman was (is?) one of the main contributors!to maxima. Quite a helpful guy, also.

Per Fateman's page, he worked on Macsyma (which was eventually freed as Macsyma) at least from the early '70s, probably late '60s. REDUCE is a similar age.

This is a cute little project that can be deployed anywhere with pip install mathics -- I even have it on my android phone (under Termux)! It can't really compete with either Mathematica or Sage, but both are multi-gigabyte programs. Unfortunately the Jupyter kernel IMathics doesn't seem to work with the current release, although it does come with its own notebook support.

I haven't had a lot of time to dig through the docs yet (also, I think your certificate is expired, btw), but this seems like a great alternative to Mathematica and the like.

This is definitely a project I can get behind.

Can confirm, the certificate for angusgriffith.com is expired.

Just renewed it (not that it'll survive the HN hug of death). It's been a few years since I've touched that website.

Came here hoping for a discussion of the project itself but this is all information about Mathematica or the fact that the developer who started it now works there.

Does anyone have an opinion on the software itself linked here?

I'm going through the exampleas and apart from some minor issues it looks like it's doing what it's supposed to do.

Sometimes I confuse the meaning of light-weight to be something that "does simple thing quickly" instead of "easy to setup". The last time I played with Mathics (maybe 2 years ago) it was still much, much slower than Sympy.

The split between SymPy functions and Mathics wrappers around these functions, together with the pattern matching is probably responsible for the slower system. Therefore in the Symja project[0] we try to implement it all together in one (Java) library. Mathematica syntax can be tested in the MMA Console[1], but the documentation of the functions [2] is in the "normally used Symja syntax", which is much easier to use for the "common calculator user".

[0] https://github.com/axkr/symja_android_library [1] https://github.com/axkr/symja_android_library/wiki/MMA-conso... [2] https://github.com/axkr/symja_android_library/tree/master/sy...

Author of the program uses let’s encrypt and the ssl certificate is expired for the documentation... https://mathics.angusgriffith.com/doc/

Just renewed it

Cert expired.

Just renewed it


If it is light-weight why don't they make web-app like Wolfram Alpha. I want to see an alternative to that.

SymPy Gamma (https://gamma.sympy.org/input/?i=integrate+x%5E2) sort of fits as an alternative, though it's not very good at parsing general questions/expressions.

Woah! That is very cool indeed. Time to start using SymPy Gamma instead of Wolfram|Alpha. Surprising that their GitHub repo has so few stars. Only 400 stars at the time of this writing. I mean, 400 stars is respectable of course, but seeing how cool this is I think they ought to have a lot more stars.

It even renders equations and graphs not as pixelated bitmaps! I should do this more often to avoid squinting while WolframAlpha-ing.

Just wanted to give a star but I saw the Google-junk and will wait until I know how you need to use Google stuff to use it because I've never read enough about GAE.

In big, bold text in the beginning of the description is the header for "Use Mathics online"

It goes to a website with "NET::ERR_CERT_DATE_INVALID"

Mathematica and Wolfram Alpha are two completely different things, though. The latter is nothing even close to just a web UI for the former.

Tangential, but reminds me of Stephen Wolfram's story of how it got the name Mathematica. It was actually Steve Jobs's idea:

"Over the months after our first meeting, I had all sorts of interactions with Steve about Mathematica. Actually, it wasn’t yet called Mathematica then … For a while he wouldn’t suggest anything. But then one day he said to me: 'You should call it Mathematica.' … he told me his theory for a name was to start from the generic term for something, then romanticize it." (Wolfram, Idea Makers)

Philosophiæ Naturalis Principia Mathematica - Isaac Newton


While I have this book in front of me: "all sorts of people were telling me that I needed to put quotes on the back cover of the book [A New Kind of Science] ... Steve said, 'Isaac Newton didn't have back-cover quotes; why do you want them?'"

This reminds me of one of my favourite Ayn Rand quotes: after being asked to shorten John Galt's (interminable, 70-odd-page, tiny print) speech in Atlas Shrugged - "Would you cut the Bible?"!

> then romanticize it

You mean romanize? And not just on the surface (latin alphabet), but even using the actual word from latin (which is already romanized greek I guess) and of course all the related living languages...

edit: I always felt strange naming a software exactly the same name (in many language) as the field it operates in. Like naming a music creation software Music, or a biology related software Biology, etc. It is like equates the software with the whole field, suggesting that there is no difference between the software and its disclipine. It is a marketing trick that have a bit of bragging side, but of course it is common pattern, e.g: https://www.amazon.co.uk/I-Am-Football-Zlatan-Ibrahimovic/dp...

I'm not sure what you're getting it. I think GP meant "romanticize," i.e., "deal with or describe in an idealized or unrealistic fashion; make (something) seem better or more appealing than it really is."

(Though in this case the intended meaning is probably a little closer to "build mystique surrounding.")

I agree with your point about naming a product to cover the whole field. It does seem off-putting--although I think examples of it are pretty rare. (In fact, I can't think of any off hand...) In this case, "Mathematica" is far enough from anyone's ordinary English usage that it doesn't fall into that category for me. I don't believe I've ever heard anyone say the word "Mathematica" to refer to anything other than the product. It would be a different story, of course, if it were just called "Math."

Mathematica" is far enough from anyone's ordinary English

Ok, I see. But it is not true for a large(not english speeking) part of the world. It is like calling your "pineapple" software Ananas[1], you just romanticize it in a small region while interfere with traditional word usage in the other part. [1] https://www.reddit.com/r/MapPorn/comments/2pp0s6/pineapple_p...

Ah! Yes, I wondered if part of the disconnect was that we speak different native languages, but I did not want to assume. (Though perhaps I should have just asked.)

When the Swiss designer Max Miedinger created a new typeface in the late fifties, his client Stempel AG wanted to call it Helvetia, which is another name for Switzerland. Max Miedinger found it silly to name a typeface after a country and suggested Helvetica - the Swiss. That's what we've got Helvetica.

> I always felt strange naming a software exactly the same name (in many language) as the field it operates in. Like naming a music creation software Music, or a biology related software Biology, etc.

IIRC Microsoft did this (Word, Windows) with hope that the press would feel the need to use “Microsoft” to disambiguate, improving brand recognition.

I definitely believe that he had nothing to do with naming it.

I would like to take this amazing opportunity to tell anyone who doesn't know about WolframAlpha to go give it a shot.

Shortest, simplest description I can give is that it is the best AI-less science-heavy digital brain out there. Or as Wikipedia puts it "a computational knowledge engine".


Edit: apparently Siri and Alexa sometimes query WolframAlpha.

And I'd like to plug my favorite twitter account, Wolfram|Alpha Can't: https://mobile.twitter.com/wacnt/

It's a collection of queries that an AI could answer in theory, but are (probably) far beyond current technology. The questions are generally just super interesting.

Here's a few recent samples: "derivative of the shore length of Tasmania with respect to ocean depth" "total area enclosed by whole notes in a typical printing of the Brandenburg Concertos" "total duration of watch adjustments made by people changing time zones per day, if everyone had a watch and adjusted it" "volume of ink saved by the Times per year if they switched to American spelling"

derivative of the shore length of Tasmania

That's a funny joke but it's not something for which any AI could provide a concrete answer. This is due to the fractal nature of coastlines and described as the coastline paradox [1].

[1] https://en.wikipedia.org/wiki/Coastline_paradox

That's great to know and I think its's something that's been gnawing at the back of my mind for some time.

My country is claimed to have the 9th longest coastline in the world despite being pretty small, and this makes me question that claim for sure.

I'm someone who occasionally works on Wolfram|Alpha and also a big fan of the account. Glad to see you're still going. Some of your examples have made me think really hard about ontological and organizational problems I hadn't yet considered.

Oh, it's not my account, I'm just a fan. All I know about the account is that it's run by the Reddit user Cosmologicon: https://www.reddit.com/user/Cosmologicon

Oh. Well still, kudos to you for spelling Wolfram|Alpha correctly with the vertical bar :)

I think those questions are just an attempt to be silly.

Most of those questions are poorly specified, if you think about them, or they're trick questions with trivial answers (like zero) in some cases.

Then there's the occasional question that could be answered, not just by some future AI, but even current WolframAlpha if it had the right dataset. Like this:

> minimum distance between a place with a 2-letter name and Llanfair­pwllgwyngyll­gogery­chwyrn­drobwll­llan­tysilio­gogo­goch

Thought it's unclear if the intent is great-circle distance or 3d distance.

If there's any doubt that plenty of these are intended to be silly questions...

> focal length of the Eye of Sauron

They're certainly meant to be entertaining. I really don't think they're meant purely as jokes, though. And which are the trick questions with trivial answers? I can't recall seeing any of those.

Any question that is poorly specified can generally be augmented with reasonable assumptions or approximations, so that an AI could potentially give an answer. W|A is a natural language interface after all, and seeing all the "W|A can" posts on the account shows that it can certainly answer questions that don't have a precise mathematical definition. The intent behind each question is usually clear to me, and to have an AI that is useful to humans, we expect the AI to infer this intent and make reasonable assumptions.

Even "focal length of the Eye of Sauron" could conceivably be given a rough answer from estimates of the eye's geometry (either from descriptions in the books, or a visual comparison with other objects of approximately-known size in the movie).

The interesting part of the account IMO is thinking through how a hypothetical AI might answer each question. Take the latest question, "derivative of the shore length of Tasmania with respect to ocean depth". This is poorly specified in that "Tasmania" only exists for ocean depths that are low enough to not completely cover it and high enough to not have another land mass connect to it, and I'm sure there's tons of other assumptions that humans would implicitly make in answering a question like that. But the topography of the Earth is approximately known, and I can see how a rough answer could be calculated. Thinking through these assumptions, and comparing current technology with what we'd expect from an AGI, is quite illuminating, and is what makes that Twitter account so awesome IMO.

Focal length of Eye of Sauron? Since when is that an optical eye? Isn't it a magical eye or some kind of partially-omniscient remote viewing, combined with awareness of what all his aligned entities are seeing? Even if it were a purely optical eye, and even if he always had line of sight to what he wanted to see, the question has fatal problems. If you assumed an infinite-resolution retina and perfect lens, and if you could exclude field of view over some arbitrary angle like 1° based on the fact that he might not be able to focus on more than one town at a time, what in the text could possibly be used to narrow down whether he has a field of view of 10m or 100m or 1km in any particular case? While we're speculating on an absurd hypothetical eye optics question, how do we even know it's not a compound eye with multiple different focal channels? Stackexchange even comes to the rescue with a quote from Fellowship stating that the eye was a pit opening on nothing (i.e. clearly not an optical eye, as "nothing" excludes a retina), and a comment further stating that the eye had no physical form and was only perceivable to a few people[1].

In that coastline question, what's the definition of shore length (isn't that a single a scalar) in terms of ocean depth (wouldn't ocean depth be zero at the shore)? If there's not a given mathematical relationship, the derivative with respect to ocean depth is zero, right? The question is confusing. I get the sense you're reading something else into the question, but it's not clear what. There's no clear definition of the variables shore length or ocean depth, there's no function relating those variables, and if there were a function I don't see why it would be likely to be differentiable.

I'll grant that some of the questions seem half serious and answerable... but mostly only if you have the obscure data necessary to answer them. Does anyone know the statistical distribution of blue whale length, or the armspan of Jesus (is that pre or post crucifixion armspan)? Does anyone know the font and font size used and ink weight and average characters per page and number of pages used by the Times in their print edition? That NYT question could be determined, but would take a fair amount of investigation to get those necessary estimates.

Questions like those are difficult for Wolfram Alpha not because it's too dumb, but because it doesn't have data needed to answer them. Not many humans, if any, have the data or knowledge to answer them either. If the questions were after ballpark figures, then the questions should be littered words like "average" and "typical", but they're not. You have questions about specific species, specific people.

Then, when it really matters, those specifics vanish: When asking the total time needed for everyone (everyone!) to adjust watches during DST changes, assuming everyone has a watch, there's no mention of watch type, or what to do about the few cripples who wouldn't be able to set the watch without assistance; would the total time be infinite then since for a few people the task can never be completed, and the question specifically said everyone, rather than asking about a typical case?

Those are just a few of the most recent questions. Given how quickly those can be torn apart, why is my original assertion even worth debating? That twitter account is, generally speaking, tweeting silly or poorly specified questions that even reasonably intelligent humans couldn't provide definitive answers for.

[1] https://scifi.stackexchange.com/questions/27657/was-the-eye-...

I'll give you the Eye of Sauron example. I admit I haven't read the books, and I've seen the films once or maybe twice.

For the other examples you mention:

As ximeng mentioned, "ocean depth" here should refer to sea level. "Sea level" would probably have been a better wording.

Christ the Redeemer is a statue in Rio de Janeiro[1]. W|A can give answers for "length of blue whale", "number of blue whales", and "height of Christ the Redeemer" (but not arm span, which Wikipedia gives as 92 ft.). It's not much of a stretch to combine those to get an estimate of the answer.

The contents of every NYT issue should be available on the internet, and some of the other figures can be found on the internet without too much trouble: the font is 8.7pt Imperial[2], and there are on average 150k words per issue[3]. Of course, these are fairly obscure pieces of data, but W|A prides itself on pulling together lots of disparate data sources. And if you don't consider having a particular obscure piece of data to be intelligence, you could easily shift the question to be, "how might an AI pull this information from the internet using natural language processing?"

For the time zone example, I took it to mean time zone changes from traveling, not just from DST (hence "per day"), and the total duration refers to the amount the watch is changed, not how long it takes to change it. Though whether the question means "sum of absolute values of differences" or just "sum of differences" is unclear.

[1] https://en.wikipedia.org/wiki/Christ_the_Redeemer_(statue) [2] https://en.wikipedia.org/wiki/The_New_York_Times#Print_newsp... [3] https://www.quora.com/How-many-words-are-in-an-average-print...

If sea levels rise by one meter, how much does the coastline shrink by?

While Wolfram alpha got me through Cal 2, why are you plugging it here?

WolframAlpha includes a lot of Mathematica features and many uses are free-as-in-beer. For example,it can evaluate Mathematica expressions like Series[x - n Sin[x], {x,0,5}]. http://m.wolframalpha.com/input/?i=Series%5Bx+-+n+Sin%5Bx%5D...

You can also get a few extra features on the mobile app, such as step-by-step solutions, if you pay a very small, one-time value (not sure how much).

There's this search engine called Google too, it's really accurate.

Be prepared to have Stephen Wolfram pull all the stops in order to destroy your project. He didn't get rich by letting free competition flourish you know.

EDIT: I downloaded the source just in case the author receives an offer he can't refuse.

1. This project has existed for quite some time and nobody has sued them

2. The originator of this (Jan Poetschko) has worked at Wolfram for several years now

3. I think at least a number of people at Wolfram understand that Octave has been an asset (or gateway drug if you prefer) for Matlab, rather than a threat

Wolfram don't make matlab. They make Mathematica.

I think it was meant as an analogy.

I never said sue. I said pull all the stops to make the project and the developer go away (or coopt it). Maybe that includes suing but probably not given how expensive lawsuits are.

Usually companies are intelligent enough to use tactics that has the greatest likelihood of success: mafioso tactics. The developer won't, in all likelihood receive a lawsuit. He'll be given an offer he can't refuse.

Maybe Wolfram already effectively killed this project. It was actively developed for about 5 years (see https://github.com/mathics/Mathics/graphs/contributors), then Wolfram Inc. hired the lead developer 2 years ago, and basically all worked stopped...

I'm confused.

The lead developer up until 2 years ago, Angus Griffith's LinkedIn says he's at Google. [0]

In April 2016, Angus replied to a comment of mine "Mathics is still maintained. There are currently two of us working on it. The last release was v0.9 in March this year." [1].

The original creator Jan Pöschko's GitHub profile states "JavaScripter making the notebook interface of wolframcloud.com" [2]. His bulk contributions to Mathics stopped in 2012, but he still makes sporadic contributions to Mathics - see here he merged a pull request March 2019 [3] - suggests Wolfram tolerate the existence of Mathics because it's not a serious threat.

As the creator of Sage, what's your opinion of the legal risks of creating a Mathematica syntax compatible clone like Mathics in the light of Wolfram Research's fairly aggressive assertion of its IP "rights"?

[0] https://www.linkedin.com/in/angus-griffith-093433b0/

[1] https://news.ycombinator.com/item?id=11465064

[2] https://github.com/poeschko

[3] https://github.com/mathics/Mathics/commits?author=poeschko&s...

Yes, that's roughly accurate. Jan Pöschko (the creator of Mathics) went to Wolfram in 2012 and I went to Google at the end of 2016. Since then it's been largely unmaintained as I don't have the time to work on it unfortunately

Thanks for the clarification Angus - appreciated.

I'm going to posit that Mathematica knows that its value proposition is not its syntax.

Totally agree with that sentiment. It's all the other stuff too.

What I'm saying is that a syntax compatible Mathematica clone, with all the other stuff too, ever took off, then Wolfram Research's playbook would be:

1. try and hire the lead developers.

2. if that failed, call in their lawyers and assert their IP rights over the syntax.

It appears as if my warning bore out then.

It's a good thing they didn't pull the plug on the github page. Now it's possible for someone to carry the torch.

Maybe Wolfram paid him $1 billion for the project...the possibilities are endless...

The developer works at Wolfram, just FYI.


He should double-check his contract to see if there's an "anything you do either inside or outside of Wolfram Inc. is automatically our property" clause.

Stephen Wolfram knows about this. He just hasn't taken action yet.

So, he's just been sitting around for several years just waiting to "take action" ... doesn't really make sense. I'd also like to think that Jan Poeschko is smart enough to read a contract.

>So, he's just been sitting around for several years just waiting to "take action" ... doesn't really make sense.

It takes ages to grow the sharks to full size, even with the extra heat from the volcano.

It's all well and good until someone forks it and tries to compete with mathamatica.

That's like saying Apple should be afraid someone straps a microphone to a raspberry pi and starts competing with the iPhone.

If the designer of the rpi works for Apple, the rpi is designed to work like an iPhone and apple. Probably owns the rpi ip the best yes its EXACTLY the same.

Is that a dare? :)

He'll take action when he determines that it's dangerous. Nobody except for police officers takes action as soon as they know about a problem.

If he’s in California, then the automatic exclusions are reasonably strong.

If he's in the United States, API copyrightability kicks in.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact