Hacker News new | comments | show | ask | jobs | submit login
Mathics - A free, light-weight alternative to Mathematica (mathics.org)
289 points by ColinWright on Feb 10, 2013 | hide | past | web | favorite | 86 comments

As others have pointed out, Mathics is missing features relative to Mathematica, so it is an alternative provided you can work within Mathics' subset of features. So if you are doing anything but tinkering it is still best to buy Mathematica.

But Mathics is great for exploring the concepts in the Mathematica programming language, a language that does not get the attention it deserves. If you are not familiar with Mathematica as a language and and are curious, see this comparison of Mathematica with other programming languages such as C, APL, and Lisp, from the first edition of the Mathematica book: http://reference.wolfram.com/legacy/v1/contents/4.2.html (this fourth section was dropped from the second edition and beyond).

As an avid user of Mathematica, I have been also partly annoyed by the language. I find that getting something (complex) to work takes much longer than ideally needed due to complex syntax. It would take still longer with other tools for mathematical problems, so I cannot really be complaining.

I "may" have discovered a language that seems better Mathematica: Modelica [1]. It turns out that Wolfram itself recently purchased a Modelica add-on to Mathematica, which it now markets as its new SystemModeler product [2].

Note that while the Modelica language is not intended towards general-purpose computations, I find the core concepts behind the language to be valid beyond its intended purposes.

[1] http://en.wikipedia.org/wiki/Modelica [2] http://en.wikipedia.org/wiki/Wolfram_SystemModeler

The language is pretty well-documented. For example:


This is something that has bugged me for a long time: how do people consider a "language reference" as a good documentation? Maybe it's because I'm not a programmer, so I'm not used to reading language references, but when I'm picking up a new language or a new tool, the most important things is to have examples on how to use the language to get things done. Take the unix manual for instance. The first thing I do when checking the manual is to search for example. Reading the list of switches is useless to me unless I have a working example of how the thing works.

So a good thing is a tutorial that guides people to the main parts of the language, explains the pitfalls, etc. I had to use mathematica to check some derivations about 6 months ago, and I spent a whole day trying to figure out how to work with it, and honestly, I nearly drowned under the documentation. There seems to be many ways to do the same thing (take the derivative of a function) and it is not always clear how/why should we use one method over the other.

Another problem I have with mathematica is that although the different functions are extensively referenced (I won't use the word documented), the language itself is not very well explained, and by language I mean how to piece all the functions together and more into one coherent piece of software.

Now I haven't spent enough time with it for my judgment to be definitive, but I found it harder to pick up than most languages / tools I've used.

i'm not sure what language you're talking about... the Mathematica Help docs are full of examples. check this Histogram page[1] and scroll down, check the Options section, Applications section, etc. that is a typical level of exemplification for a function like Histogram, and other functions are detailed as appropriate and the examples regularly showcase how to use various functions/functionality together.

i think what may have happened in your case is that you believed Mathematica was a math-specific tool (which it isn't) and so you didn't pay enough attention to the non-math aspects of the language, such as the basic API (for which there is replete documentation/examples in the Help docs, see for example [2]).

the most useful key in Mathematica is F1. click on anything, any symbol or function, and hit F1 to see the Help page for that item

[1] http://reference.wolfram.com/mathematica/ref/Histogram.html

[2] http://reference.wolfram.com/mathematica/guide/ListManipulat...

"how do people consider a "language reference" as a good documentation?"

"when I'm picking up a new language or a new tool, the most important things is to have examples on how to use the language to get things done"

You look for different things when you think about how to implement the language. In a sense, the implementation doesn't really care about the use cases: it merely cares that the behavior matches the stated behavior in the documentation.

the IDEAL documentation for a developer is a proper PEG/LALR grammar for the language. That way you can properly parse expressions. Clearly they didnt provide it.

The documentation gives enough information to reduce an abstract expression from the GUI down to a mathematica expression, which is enough to build an AST. From there, it's a matter of building up each component to match the semantics.

"Another problem I have with mathematica is that although the different functions are extensively referenced (I won't use the word documented), the language itself is not very well explained, and by language I mean how to piece all the functions together and more into one coherent piece of software."

That's the job of the programmer. The documentation should explain how each bit works and the rules for combining the bits, but it's up to you to take the pieces and build something.

Think about Legos: you have a pile of bricks, and no one is going to tell you how to build a rocket ship using those pieces. That's up to you :)

"Take the unix manual for instance. The first thing I do when checking the manual is to search for example. Reading the list of switches is useless to me unless I have a working example of how the thing works."

The manpages do a poor job of explaining the zen of unix. Once you start thinking of operations as transforming streams of text, then you start thinking of tasks in terms of smaller units.

For example, a few minutes ago I needed a way to upgrade all global `npm` modules. I knew there was a way to get JSON lists (npm list -g --parseable --json), which lines I wanted (the ones starting with ' "'), and what I want to do with those (get the name and install). Putting it together, one straightforward way is

    npm list -g --parseable --json 2>/dev/null | grep '^    "[a-z-]*": {' | sed 's/^ *"//;s/".*$//' | while read x; do sudo npm install -g $x; done
Now, the documentation doesn't explain that this is a way to do what I want. But the documentation gives enough information to know where to look.

You are describing ideal documentation that an implementor needs, not documentation a user needs.

There is this on the language features


which is just a little more recent. But I agree that Mathematica should be explored more as a general purpose programming language.

I love Mathematica and use it nearly every day.

However, I would not recommend it as general purpose language because of its proprietary nature.

The $295 barrier to entry is way too high. Unless there are better interpreters than Mathics (which as someone mentioned is great, but is just a subset) around, I don't see the point.

Oh, come on! Considering the approximately $2,000 price for standard commercial versions of Mathematica, MatLab, and Maple, the $295 for the home version of Mathematica is quite reasonable. If you want to freeload, get Sage (which is quite good, btw).

Wolfram now has a version of Mathematica called "Starter" which costs $995 CAD and can be used for commercial purposes (unlike the home version). The Starter version only gets upgrades for one year, but you can keep using it after one year.

>The $295 barrier to entry is way too high.

People spend that much in dog food.

This is a tool with years of work by a huge team behind it, with hard-core scientific innovations built in, and which you are supposed to use for years professionally.

Imagine if dentists said: "I will use a hammer to take out your teath. I cannot justify $10,000 for this proprietary machine for company X".

Seems like everyone's misunderstanding my sentiment--now that I look back, I was pretty unclear.

I'm not arguing that Mathematica is too expensive. I think it's worth the money and more for math/science/engineering work. I was glad to pay up because it fills that niche for me.

My beef is with the suggestion that it should be used for general purpose work, like scripting. I believe that if people need advanced math features, Mathematica is extraordinary. But dropping $295 for a proprietary system as a replacement for Ruby or Java?

you love it. you use it every day. $295 is too high?

You cannot share your source code in a way that those who matter to you can modify and run, without them paying the price too. Including your future self.

And you cannot take anyone out for a ride, unless you buy a car.

He's saying that you cannot take anyone for a ride unless they buy the car also.

? The license is perpetual.

I'm not arguing that it's a bad language. I was happy to pay up. It perfectly suits my needs.

I'm just saying that it'd be a ridiculous "general-purpose" language because anyone who wants to use it must shell out nearly a third of a grand.

I think it fills a fantastic niche for math and science, where its powerful capabilities really come in handy. But general purpose scripting? Silly.

Why would the price make it ridiculous to use it for more puprposes and thus amortize its cost?

Ahh, I was assuming the parent to my comment was implying that people who don't already have Mathematica should check it out for general-purpose programming.

If you've already bought Mathematica, great, use it for whatever you want! However, I don't think you should buy it unless you actually need its advanced features.

Last time I checked Wolfram wasnt even hiring. . . . . . . Why bother learning Mathematica or writing your own free version i mean seriously? There are perfectly good Javascript libraries for doing whatever "math" stuff you feel like burying your nose in and another thing. . . . It's actually impossible to write a computer program that will prove anything significant. Turing figured that out like 80 years ago, get a clue morans

>Why bother learning Mathematica or writing your own free version i mean seriously? There are perfectly good Javascript libraries for doing whatever "math" stuff you feel like burying your nose in and another thing. . . .

Not very familiar with this "math" thing, are we?

>It's actually impossible to write a computer program that will prove anything significant. Turing figured that out like 80 years ago, get a clue morans

It's "morons", I believe. And Turing figured nothing of the sort.

Not to mention that it's very easy to write a computer program that will prove something significant (as long as you don't expect the program to do the whole proof itself, which it can also be done).

I would suggest not to choose languages based off of who's hiring.. that being said.. Wolfram is always hiring..

Mathematica's language / environment is very effective at rapid prototyping math, computation, and physics applications... Thats why people use it.

He's a troll rapidly on his way to a hellbanning, don't waste your breath.

This topic already mentioned on HN before http://news.ycombinator.com/item?id=4066826

And an interesting point is that, the core developer of Mathics is also a Kernel Developer at Wolfram Research. Jan Pöschko's website http://www.poeschko.com/

How could he build a free product compete with his company's product?

He started working for Wolfram in December 2012, and as noted on his blog, he quit the Mathics development.


Jan Pöschko's website (it's at http://www.poeschko.com/) explains how he squares working on Mathics and Mathematica.

It says he no longer works on Mathics since being hired by Wolfram. Alas often a way to try to weakene open source competition...

Yes, my post was a slightly cheeky way of pointing out that the answer is in the page linked to by the very post that poses the question :)

As for weakening free competition, that's plausible, though I think it more likely that the chap was hired on the basis of his work than as a strategic move. Mathematica seems pretty entrenched and comprehensive (though I do admit that it's not something I've used a great deal), and probably as impervious to attack from open source equivalents as is Excel.

(While MS seems currently troubled, and I bet they're finding it harder and harder to persuade people to upgrade to Office each year, Excel's position looks pretty unassailable.)

    This topic already mentioned on HN before
Indeed, about 8 months ago. Judging by some of the criticisms there, progress has been made, so it's probably worth this extra outing.

If by "progress" you mean that they addressed the specific concerns, sure.

veyron http://news.ycombinator.com/item?id=4067025 pointed out that

was broken, but now it's fixed.

programnature http://news.ycombinator.com/item?id=4067225

    Plot[Sin[x], {x, -5, 200}]
appears that issue was resolved as well.

However, most of the comments seem to be directed at mathematica's language (none of which were resolved, seeing as how the goal was to replicate mathematica)

Why use the Mathematica syntax, and not a better one? It's rather annoying syntax, Matlab and Maple are much better for this. Mathematicians don't use square brackets for functions, most programming languages don't either, but Mathematica, a mathematics language ffs, does. And sin and cos with capitals, meh.

Mathematical notation is ambiguous and therefore unsuited to parsing as a computer syntax. s(x + y) can represent scalar multiplication, or function application. Mathematica only uses s(x + y) for scalar multiplication and s[x + y] for function application to avoid this problem. Sin[alpha], etc. is just a symptom of its consistent naming convention for built-ins. The use of Capitalised names frees you to create your own function names in lowercase without fretting about namespace conflicts.

I've downloaded Mathics onto my Mac, unpacked it, installed it and tested it without issue. The web interface works well too. I'm very impressed with this software and appreciate all their efforts, especially what appear to be well commented sources. To complain that a better notation could have been used is to completely miss the point. This is for people who would like to use Mathematica syntax but can't afford the licence. I've got four books on Mathematica, but can't remotely afford to purchase it.

How about $300 for the home version?

This is a rather superficial objection. Using square brackets for function application frees up juxtaposition for multiplication (without introducing ambiguity like in standard mathematical notation), so that's just a tradeoff. The use of capitals is consistent and helps distinguish builtin functions from user-defined functions and variables. These particular conventions are really things you get used to quickly, unless you're deliberately trying to be annoyed by them.

"Mathematicians don't use square brackets for functions"

Not true at all:

1) Operators acting on a distribution: E[X], Var[X], Cov[X,Y]

2) Square brackets are used in nested parentheses to avoid confusion: [1(2 + 3) + 4]/5

3) Functionals: L[f] for lagrangian

The main reason why [] isn't used as frequently as () is because most domains interpret the square brackets to mean something special. For example:

1) [x] is often used to denote floor(x)

2) [i=j] is used to denote the kronecker delta

On point (2) -- In four years of being a math major, I don't think a single professor ever used brackets in that situation, only additional parentheses.

I'm inclined to agree that it's use would be uncommon, I've not encountered it in 30 odd years of reading papers and talking math (or rather I don't recall noticing it's use).

What I must point out is you make a weak case based on myopia- for example; in 15 years of working with tens of thousands of hours of high resolution radiometrics I've never once met and talked to a dendrochronologist who's looked at the radiometric signature of individual bands of Japanese pine trees.

It's my understanding that such beasts do exist.

Another math major here (in my final year). My professors routinely use square brackets after the second or third level of bracket nesting.

I think it must depend on the professor/university.

It's common in engineering. I like it because it makes matching parenthesis much easier.

It uses Sympy and SAGE under the hood, you'd probably prefer their syntaxes.

Personally, I like that Mathematica uses capitals for functions: it means that the entire namespace of lower-case variables is free - unlike in Sage, MATLAB etc... In fact, this is how you're supposed to name your variables in Mathematica.

For one, Mathematica tries hard to keep its syntax consistent, even if it has to break backward compatibility sometimes. Naming convention in Matlab is often inconsistent (even though Matlab also at times changes things to break backward compatibility).

Also Matlab's documentation is often not complete, frequently requiring Google searches. I have rarely needed that with Mathematica.

My core reasons to use Matlab at times are:

1. More toolboxes, including those from third-parties 2. More team members familiar with Matlab than Mathematica

You can either have (a) consistency or (b) convention. Most people would jump at the opportunity to ditch (b), re-invent the wheel, and establish (a) just for the cleaner semantics.

Any mathematician will agree: mathematics is invariant under change of notation.

But sometimes the right notation can make things simpler and easier to understand. (e.g. Einsteins Four-Vectors)

But mathematics communication is not, hence new fields coming to life when a great notation is introduced.

I am an avid Mathematica user. Not because I need to evaluate that much math, but because I really like its wysiwyg notebook structure for note-taking. It's great for keeping up with lectures and including decent looking equations and tables when they come up (which is fairly often in technical classes). The export to latex is a nice added bonus.

As far as I know, there aren't great alternatives to the Mathematica front end - I'd love to be proven wrong, through.

The ipython notebook is rapidly moving in that direction. See http://nbviewer.ipython.org/ for some examples. It can even embed R, ruby, bash, and Perl code.

Personally I'm looking forward to start playing with this: http://reference.wolfram.com/mathematica/RLink/guide/RLink.h...

If you do, make sure to read this discussion: http://mathematica.stackexchange.com/questions/16657/special...

part of what makes Mathematica notebooks particularly powerful is that they are Mathematica expressions themselves (Mathematica expressions are M-expressions), thus they can be thoroughly manipulated in all sorts of ways.

then there's Dynamic[1], which is the most straightforward event mechanism you're going to find in any language

[1] http://reference.wolfram.com/mathematica/ref/Dynamic.html

check out the sagemath project, too.


there are some other electronic notebooks out there but not many do latexification, drawing of inline graphs, etc.

Yes! I took all of my math notes in university in Mathematica notebooks. Lead to much quicker and deeper understanding of the material, not to mention the side effect that I then knew how to actually use the math to solve real problems.

One thing that came out of that was a nice Wheatstone Bridge calculator w/ GUI that was really useful for prototyping signal acquisition circuits.

Ugh. Ask your professor to provide notes, so you can learn, instead of scribe. Or offer to provide yours, with compensation for your efforts.

Bessel functions aren't supported (and even Excel supports them!)


On mathematica I get

    $ /Applications/Mathematica.app/Contents/MacOS/MathKernel 
    Mathematica 8.0 for Mac OS X x86 (64-bit)
    Copyright 1988-2010 Wolfram Research, Inc.

    In[1]:= BesselJ[1,2]//N

    Out[1]= 0.576725
In excel, `BESSELJ(2,1)` is the same to 5 significant figures.

"Developers Wanted" is on the first page. Being on open source project, you'll probably see a lot of organic growth and people scratching their own itches.

There's also free alternative to Matlab, the GNU Octave http://www.gnu.org/software/octave/

Maxima [1] is both a predecessor and alternative to both Mathematica and Maple.

It is an descendant of DOE Macsyma, which ran only on expensive Lisp machines, and porting it to PCs was slow enough to give Mathematica and Maple a headstart.

It is kind of a shame that all the math and physics departments all over the world keep using closed source black box solvers instead of working on improving free and inspectable alternatives like Maxima, Octave, Sage, etc.

[1] http://maxima.sourceforge.net/

> It is kind of a shame that all the math and physics departments all over the world keep using closed source black box solvers

They use them because they're more comprehensive, and scientists want to spend their time doing science, not improving free software.

Also, in the case of Mathematica, the interface and feature set are far beyond what any other tool offers (and can be expected to offer, given the track-record of free software).

> scientists want to spend their time doing science, not improving free software.

Wasnt the whole point of science to build their own chain of verifiable tools to rely on, instead of having to trust secret, unverified commercial black boxes?

Cynically, the point of doing science is to secure funding. Your ability to receive funding is based on your publication record. Improving software takes time away from writing papers, and is therefore counterproductive. Improving free software is even more counterproductive, as you are giving your tools away to your competitors.

"Wasnt the whole point of science to build their own chain of verifiable tools to rely on,"

... No it wasn't and isn't, what gave you that idea?

Eh. Is Richard M. Stallman teaching philosophy of science now or something?

Arguably, the rough idea is to discover and prove interesting or useful facts.

Yes, but discovering and proving interesting or useful facts requires some degree of transparency and replication. It's at least better, when possible, for a scientist to use apparatus whose functioning they can inspect, and that includes any major software components.

That's a bit different from Stallman's focus. Stallman is mainly interested in the freedom of users to modify the software they use (and share those modifications). But for scientific software the real issue is whether scientists can look at how it works. It would be fine for it to be under a "look but don't redistribute" proprietary license.

Other things being equal, it really would be better to use a more transparent apparatus.

But other things aren't equal, and the productivity difference is order(s) of magniture more important than the transparency of an apparatus that has been successfully used by many others and is believed to give correct results.

Octave is currently available on Android - search the Play store. A very impressive effort.


How is it different from SAGE[1] and Maxima[2]?

[1] http://www.sagemath.org/ [2] http://maxima.sourceforge.net/

It uses mathematica's syntax.

This is a rather superficial reason to start such a project.

Mathematica is non popular because of its syntax, it is popular because of its extensive library, graphics capabilities and documentation.

If you want to make free software packages more competitive compared to mathematica, the best way would be to work on extending their libraries, documentation and graphical capabilities, not increase the fragmentation by starting yet another package from scratch doing the same thing just using a slightly different syntax.

For all intents and purposes, from an user's point of view, this project is as a waste of time as writing yet another scheme interpreter.

Mathematica is powerful because of its syntax. http://www.paulgraham.com/power.html

Years ago, I wrote a very rudimentary tutorial on Mathematica to get undergrad chemistry students started on it. http://www.cem.msu.edu/~cem883/mathematica-instr.html

The good thing is that mathics make very nice plots (at least for simple functions I tested). The bad news is that it stumbled on a simple NIntegrate.(*) It certainly has potential though...

[ Edit: Hmm looks like Integrate[] does what NIntegrate in my example was supposed to do. I take the "bad news" back.]

http://mathematica.stackexchange.com is a good place to look if you need mathematica-related help

Guys, also don’t forget: what we currently see is a snapshot in time. Right now Mathics offers the features X and Y and lacks Z. But this may change over the next years.

As several posters said, nothing will beat matlab with its long list of tool boxes. It would be nice if there is more open source work in building more tool boxes for Octave(octave is open source compatible to matlab).

Looks, very nice. I tried some basic Mathematica functions (D[], Plot[], ...) and at least that subset all worked as expected.

I couldn't find a full table of compatibility with Mathematica though, anyone know where one is?

Really nice, but it supports only the very basics e.g Plot[x^2, {x, -1, 1}, AxesLabel -> {x, y}, PlotStyle -> Dashed, Filling -> Bottom] ignores all options And D can't compute JacobiP derivative even with Simplify[ D[JacobiP[n, a, b, x], x] == 1/2 (1 + a + b + n) JacobiP[-1 + n, 1 + a, 1 + b, x]]

It's startling how much work goes into something like Mathematica, too bad it's not open source, and have to be redone:(

Closed source paid the salaries of the people who put that startling amount of work in.

Heres a little incompatibility. The following code is valid Mathematica code, but the on-line parser rejects it


This works in both places (just remove the `+`):

Both give 2 Sqrt[Pi]

Thats the point :-) In Mathematica the `+` is supported

This is a known issue in Mathics that has been fixed in the upcoming version 0.6 (soon to be released).

Mathics vice dictator here btw.

I'm using SAGE right now for calculus. The point is to have the computer do the tedious work. But until I learn python, I end up spending my time fidgeting around with the syntax instead of actually learning calculus. I'm all for programing integrated with academia...but we need better software (like Mathics!)

What's missing for IE9/10 support?

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