105 comments

[ 2.5 ms ] story [ 161 ms ] thread
Would have been great if this version fixed the syntax.

Square brackets for function arguments makes no sense, neither mathematically, nor programming language wise :)

Same for Sin requiring a capital letter, and curly braces instead of square brackets for matrices

Builtin functions in at least most previous versions of Mathematica have required capitalized names; I think it's got to do with disambiguation vs user-defined functions (e.g. builtin `Sin` is the mathematical sine funciton, while the user-defined `sin` prints the seven deadly sins for whatever reason -- you still retain access to both this way).

As for square brackets for parameters, it's unconventional, for sure, but not ambiguous because list literals use curly braces anyway.

Won't it be a huge breaking change?

Consistency and backwards-compatibility are much more important for most existing users, whatever their aestetic preferences may be.

Those are such trivial details! These are the things that matter in day one of using the language, and make no difference for anyone who has made the slightest effort to get familiar with the language. Breaking compatibility for such a silly style reason would be the height of stupidity!
The syntax is consistent and works fine, and I'm not sure that changing the syntax so it looks like some other programming language is a good use of anyones time and energy
Square brackets – one keypress. Curly brackets – two keypresses, shift and the other bracket key.

Result: reserved key for brackets, instead of mixing brackets and numbers while making the only kind of bracket an entire key more to get to.

Evaluation: it's clean and efficient.

On most European keyboards brackets are both two keypresses.
I actually really like the consistency of Mathematica's syntax - parentheses are reserved for grouping expressions. You can also create matrices using the cell inputs in notebooks, which uses standard mathematical notation.
There are really good books out there for learning Mathematica. A foreign - but coherent - syntax should not be a dealbreaker for any professional or craftsman.
Wow, he's rather fond of himself, isn't he.
Okay, it's been said. Now let's move on. For more, see all previous submissions with SW as the author.

Beneath all the bluster, the product does in fact appear to be an embarrassment of riches for programmers (or at least its customers).

Yes. It's kind of a test for HN whether the thread can discuss anything other than this.
My favorite version of this: "I wonder what will become self aware first: Mathematica or Stephen Wolfram"
Great news. I'm particularly excited to see that they're implementing more thorough builtins for working with ANNs and other ML abstractions.
If you want to know more about the neural network stuff specifically there is a gallery of marketing examples at http://www.wolfram.com/language/11/neural-networks/?product=... and quite a few examples at http://reference.wolfram.com/language/ref/NetTrain.html (look under Applications near the bottom of the page).

The current selection of layers is biased a bit towards vision, but my colleague and I are working on recurrent networks as we speak, which will unlock networks that operate on text, audio, and other data of a sequential or temporal character. Hopefully that will land in a few months with 11.1.

>other data of a sequential or temporal character

Awesome! Good to hear that there will be abstractions for general data processing too, and not just audio/video/text.

reference.wolfram.com seems to be down as I write this, but I'll check back in a few hours.

If you're working on Mathematica as your comment implies, thanks for your contributions. It's a wonderful piece of software (even if closed source)!

I do wonder if they have ever thought of building a Mathematica Machine like the old Lisp and Smalltalk machines?
And what good would that be? Besides being single purpose and not running tons of other software?
It just seems like they are including everything into their product that I could actually see them selling a dedicated device. I could almost see them building an actual notebook (well, tablet) that runs only Mathematica.
I doubt it. I think the big take away lesson from the language specific machines was that it's not worth it. LOTS of money is spent on the R&D that goes into making x86, ARM, etc. faster and better each iteration, and without the economies of scale that come with a huge install base, it's basically just a money pit. Even if a dedicated Mathematica CPU was faster now, the x86 version will be faster in a few years anyway.

It might make sense one day when when processor improvements level off even more than they already have.

On the other hand, it might be a neat idea to OEM a high end x86 system and sell it as a purpose built "mathematica machine," with Mathematica pre-installed, the best supported GPU, optimal RAM and CPU, etc.

> I think the big take away lesson from the language specific machines was that it's not worth it.

I think the take away was learned when every generation of the x86 would be a significant leap in performance. As you say in paragraph 3, things might change with the leveling off of improvements.

> On the other hand, it might be a neat idea to OEM a high end x86 system and sell it as a purpose built "mathematica machine," with Mathematica pre-installed, the best supported GPU, optimal RAM and CPU, etc.

I've been pitched by salesmen that their machine is a killer machine for Mathematica. We don't use it here, so I was not really into it as much as buying the sealed medical computers for the carpentry people.

A lot of Mathematica is already written in Mathematica. When Apple switched Macs to Intel CPUs, they included Mathematica as a flagship program, and flew their engineers out to do a port in secret. One engineer said the hardest part of the port was deciding what to do with the rest of the weekend.
How much was because a lot of it was written in mathematica vs. it already being cross platform an running on x86 on Windows/Linux?
You would not really need a specialized CPU anymore for a Lisp Machine. Those CPUs were invented to keep instructions small and efficient, provide large address spaces and enable simple compilers. In the last part of the 80s the trend to RISC CPUs was clear and several RISC CPUs were developed for Lisp, but they did not reach the market anymore. The SPARC cpu was mildly inspired by Lisp / Smalltalk. Since new CPUs were not happening for Lisp (there was no money for it), two of the existing CPUs were ported as VMs to other processors (Symbolics Ivory to ALPHA because of its 64bit support) and the Xerox Lisp system was ported to x86 and SPARC.

Besides the CPU there is another, even more important, difference. Lisp systems were all the way down to the metal developed in Lisp. Mathematica is largely written in C++ (runtime, environment, ...) and runs on top of a conventional OS (Windows, OSX, Linux, ...).

Lisp Machines had already something like Mathematica.

It's called Macsyma and existed long before Mathematica. Macsyma was ported to Lisp Machines, in fact Lisp Machines exist partly because of Macsyma. It was one of the early Lisp applications which needed better and dedicated (not timeshared) hardware.

http://lispm.de/macsyma/macsyma.html

I recommend that Stephen Wolfram skeptics read this press release. I was surprised by language-level support for 3D printing:

    In Version 11 it’s finally realistic to take any 3D plot, and just 3D print it. 
I didn't know that I wanted this until I saw it. Generally I prefer small, simple languages. But Mathematica is my favorite large language.

I'm also happy that, even though Mathematica 11 introduces flashy features like 3D printing support and a Logo-derivative, it also includes improved support for calculus. Is there anyone else like Wolfram, i.e. a math-person who presides over a very-pragmatic, very-large programming language? That's not a rhetorical question.

A question for Mathematica-folk: does Mathematica have support for direct manipulation like Toby Schachman's works?[] I find direct manipulation more pleasant than typing characters.

[] http://tobyschachman.com/

> A question for Mathematica-folk: does Mathematica have support for direct manipulation like Toby Schachman's works?[] I find direct manipulation more pleasant than typing characters.

Locator comes to mind:

https://reference.wolfram.com/language/ref/Locator.html

https://youtu.be/6wOLBVFdek8?t=11s

And more generally Manipulate which makes it easy to whip together a let-me-explore-how-this-depends-on-that type of widget.

check out demonstrations.wolfram.com too - it's a place you can put manipulations if you want to use them in a class, etc
William Stein, number theorist at University of Washington, founded and built up Sage. It's designed to be cloud-based and acts as a common interface for many things (including Mathematica, Maple, Matlab, etc.) but also has it's own libraries. Will recently went on leave from UW to work full time on Sage.

Description from: http://www.sagemath.org/

"SageMath is a free open-source mathematics software system licensed under the GPL. It builds on top of many existing open-source packages: NumPy, SciPy, matplotlib, Sympy, Maxima, GAP, FLINT, R and many more. Access their combined power through a common, Python-based language or directly via interfaces or wrappers. Mission: Creating a viable free open source alternative to Magma, Maple, Mathematica and Matlab."

> Generally I prefer small, simple languages.

I would argue that MMA is a small language hiding behind a gigantic, domain-specific library.

Yes. Wolfram is a small language, with the world's largest standard library.
It helps that the huge library has some of the best documentation I've ever encountered.
If a massive standard library, or really any library, doesn't have good documentation how do you find out about it?

In some statically typed languages like C# and Java you can use an IDE's object or interface explorer to see what the classes, methods, and properties of a class lib are. If that's missing do you have to use introspection or reflection? In a REPL if the language has one?

Is it assumed a compiled language will be statically typed (though that doesn't have to be true) and if it's not the source code will come with any library so examining it is easy?

The thing is, the entire standard library is in the default namespace. I personally dislike that, but then again, I was raised on python.
For those that haven't used Mma, the uppercase/lowercase convention helps a lot here. Built in functions start with uppercase letters, like LinearProgramming. You should name your functions with a lowercase letter. So the namespace is messy, but you're never going to accidentally collide with a built in name.
(comment deleted)
(comment deleted)
If I didn't know better I'd have assumed from all the first person pronouns that Wolfram is the lead developer and coded 90% of the new version's features himself.
From what I've read, Wolfram is a very micromanaging [1], so he probably did have his input in all of the features.

He mostly states it himself:

Hundreds of us have been energetically working on building this for the past two years—and in fact I’ve personally put several thousand hours into it.

[1] Read some of the comments from Glassdoor (https://www.glassdoor.com/Reviews/Employee-Review-Wolfram-Re...)

It now has

data on Pokémon and lots of other useful things

I love this - will be able to show off my kids a tool that I use all the time for work.

An open question independent of the author: What do people use Mathematica for that can't be done in R, SAS, Matlab, SPSS or Python libraries.

Is it a great innovation that other tools have caught up with, or is it still getting a lot of use at the bleeding edge?

It's one of the few systems I've seen that is simultaneously a good programming language, good at symbolic computation, and also good at numerical computing.
>An open question independent of the author: What do people use Mathematica for that can't be done in R, SAS, Matlab, SPSS or Python libraries.

All those don't offer a seamless environment, that's hassle free, easy to setup, with commercial support, a great GUI, great documentation and works across so many science domains and with different approaches.

So, the question is quite (but not that severely) like "what people do with excavators that you can't do with spades".

The answer is, nothing much, except tons.

We (see https://cloud.sagemath.com) and others (e.g., https://www.continuum.io/) do offer commercial support for Python (etc.) and an easy to setup environment. Of course, Matlab is also commercially supported by Mathworks, and it seems that R is now commercially supported by Microsoft (https://www.microsoft.com/en-us/cloud-platform/r-server).

[Edit: added Microsoft]

and an easy to setup environment.

Hardly so[1] --especially for general/non-technical users.

[1] http://doc.sagemath.org/pdf/en/installation/installation.pdf

I think he's referring to commercial support for a Python environment at cloud.sagemath.com, for which there is zero setup. Just go to the link provided. SageMath is also available there with zero setup. You don't need the Sage installation manual to use it there.
I don't think that's really the answer --- e.g. Matlab has all of those (and the open source things are YMMV).

The reason I've seen people prefer Mathematica is because its symbolic computation and visualization capabilities are both powerful and easy to use for basic things. Here, it is just very good, as to be expected from popular software with a long history with significant resources spent on its development. (The open source alternatives for symbolic computation may be as good in some applications for experts in some mathematical fields, but the general purpose user experience is not as good. As an alternative to Mathematica, I'm currently using Sagemath, and while it's perfectly OK for many things, the polish is often lacking.)

>Matlab

That's true, Matlab does -- I was referring mostly to the others, disparate attempts at a cohesive solution.

> hassle free, easy to setup, with commercial support, a great GUI, great documentation

Which of those doesn't apply to R?

> works across so many science domains

Mathematica offers the same statistical capabilities as R? Granted, I haven't used it in years, but that would be a new thing if true.

First-rank symbolic calculation is absolutely critical.
Mathematica is kind of the opposite of "the bleeding edge". If you want the latest algorithms, statistics, etc., those will be found in R, C++, Python etc. in the author's website. If you want well-tested, mostly-robust algorithms, those (might) be in Mathematica; they follow innovation, rather than leading it.

Mathematica also has some algorithms from the 70's and 80's that aren't widely available as open source, and then there's the notebook interface (but see Jupyter / IPython). The part I've found most useful has been Wolfram|Alpha; it's really nice to be able to say "August 2, 2016 - September 4, 2017" and get back the number of days, weeks, and hours between those two times.

>> some algorithms from the 70's and 80's that aren't widely available as open source

What would be those (if you got a minute)?

I was thinking of symbolic integration when I wrote that, but there are also the various numerical solvers and special functions. Honestly though I'm not sure, I never really got into that part of it.
Mathematica uses GMP and Linpack for example and those might be used by R or Python also.
>> The part I've found most useful has been Wolfram|Alpha; it's really nice to be able to say "August 2, 2016 - September 4, 2017" and get back the number of days, weeks, and hours between those two times.

In Python:

    import datetime  # standard module
    timedelta = datetime.datetime(2016, 8, 2) - datetime.datetime(2017, 9, 4)
    timedelta.days
    > -398
    timedelta.days / 7
    > -57
    timedelta.days / 7.
    > -56.857142857142854
    timedelta.total_seconds() / 3600.
    > -9552.0
In particular, that you can pretty much ask anything to Wolfram|Alpha, and that it has to figure out exactly what you're asking (and I admit most of the time, it does it), always seemed more like a marketting ploy than a real feature to me. I can't go as far as saying that I dislike it, but the few times I tried to use it, it didn't get what I was trying to "ask" and I just gave up.

--> I also admit it might be me that I just don't get the tool.

Yuck.
It looks a little nicer if you say

    from datetime import datetime, timedelta
But the code already looked pretty good to me.
Add a parser (so I can say "August" or "Aug" instead of 8) and I might start using it (just because the Wolfram|Alpha page loads so slowly).

For example something like this: https://dateparser.readthedocs.io/en/latest/

Importing packages every time I want to use them is rather tedious though. I guess I need PYTHONSTARTUP as well.

Overall, though, 10 minutes to setup something I only use once or twice a year seems like a waste.

No need to, already included (though I'm not so familiar with the datetime module, so I had to look for it):

    datetime.datetime.strptime("Aug 18 2015", "%b %d %Y")
    > datetime.datetime(2015, 8, 18, 0, 0)
Like xapata said, if you import from datetime, it looks "nicer". I prefer to see where things come from most of the time, because I keep open long sessions and it can become messy otherwise.

I don't really see how this can take 10 minutes to setup. You can have the import already in a file called dateutils.py and you only set it up once:

    import datetime
    def string2date(val):
        return datetime.datetime.strptime(val, "%b %d %Y")
Then your session becomes easier

    from dateutils import *
    string2date("Jul 4 1776")
    datetime.datetime(1776, 7, 4, 0, 0)
However, I think at this point we're talking more about our personal preferences for tools rather than the original subject. It just struck me that your example was something that is available in Python using standard library modules.
It is how mainstream programming might have looked like if Lisp Machines instead of UNIX had caught on.

Other than that, it is as coldtea answers.

Not every mishap in computing is the fault of Unix. :) SBCL and ACL2 run quite nicely on Unix, and their authors haven't been deterred by it. Neither have the Mathematica authors.
Yeah, the rest is fault of DOS.

While these Lisps run fine on unix, they do not define how the system is programmed, but are "just" another application environment. It's still pipes/signals/ioctl()s down there.

> What do people use Mathematica for that can't be done in R, SAS, Matlab, SPSS or Python libraries.

Nothing; but Mathematica has been the tool of choice for cs education (or math+cs) and people tend to stick to what they know.

I think you're thinking of Matlab. Mathematica isn't particularly huge in education (yet).
Matlab might be more popular in engineering, but Mathematica is pretty pervasive world wide in math and physics especially
Can you elaborate on why Matlab is more popular in Engineering and Mathematics in math and physics?
Not sure, could have to do with early marketing in the 80s - we all know academia likes to stay on a path regardless of new developments. Could be as simple as "Mathematica" has math in its name and was developed by a physicist...and "Matlab" has lab in its name. Fickle folks, idk.
And this is actually a terrible thing. Fortunately my school did this stuff with the Python stack, however the situation is similar to MS Office - it is taught in schools (general education I mean) and so people struggle with e.g. LibreOffice.

However I have to agree that the UI of Mathematica is superb. Jupyter Notebook is a nice free alternative, but its recent development (Jupyter Lab) seemed very "ideish" and got me scared (do not get me wrong, it looks pretty slick and must have been complicated to engineer - but for me the nice thing about the notebook was that it is _not_ an IDE like Netbeans, Eclipse, QT-Creator - i.e. the classic ide UI that is separated into editor, file-viewer, shell and something like variable inspector). But this is a different story.

I've used Mathematica, R, and Python extensively, and even Matlab (cringe). I reach for Mathematica when I need to do something symbolic (algebra, derivatives, etc.), and also for the built in graphics.

It is easy to interactively build up plots that give good insight into my data. It also is easy to problematically create quite complex plots. It is enough better at that that I don't just stick with R or python. I can get it done faster in Mma, and the plots also look nicer.

The distribution (random number) functions are also very nice, which I often use hand in hand with the histogram, when I want to play around with statistics.

Edit: The graphics also scale better for largish data sets. If I want to plot a few hundred thousand data points, Mma feels a lot faster.

> I reach for Mathematica when I need to do something symbolic (algebra, derivatives, etc.)

So, when do you use Matlab? Can you give me some real life examples that illustrated your decision?

Lets say you want to build some fancy DIY project, like a food dehydrator. You want to make some mathematical models of the thing, so you pull up Mathematica.

To start with, maybe you want to solve some simple mass and energy balances on the thing to find out how much power it will take, and how long it will need to run. No problem, Mathematica does basic algebra right out of the box. It's also got a nice units system, so you can convert things easily.

Now you realize that your mass balances have turned into differential equations. No problem. Mathematica has that built in and you can immediately plug your mass balance equations into the ODE/PDE solver and get analytic or numerical answers.

Now you are interested in how to run the fans/heater so that your dehydrator stays in the safe ranges. No problem. Mathematica has that built in, and you can immediately start working with Mathematica's process control tools.

Now you've built the thing, and recorded some data. You want to make a calibration curve for your thermometer, refine your model's parameters, and make some graphs. No problem. Mathematica has built in data processing, curve fitting, and plotting tools. You can immediately get the answers you want, and plug them into your earlier work.

Of course, you can probably do all those things in python, or R, or Matlab. But in Mathematica, you don't even need to install optional components between each step. There is no hunting down and learning some 3rd party library. There is no need to try to wrestle your symbolic work into a form that your numerical number cruncher tool can understand. There is no creating awkward pipeline code to shoehorn the results of your statistical analysis back into your differential equation. Things play nice with each other.

This describes well how I use Mathematica. I would also add that compared to Matlab you pay for single license and get whole thing. With Matlab you send list of toolboxes to a manager and got asked "Do you really need symbolic toolbox?" With tools maturing there is a push to use Python for prototyping, but the experience is still not as seamless as with Mathematica.

That being said, from my experience Mathematica is best for prototyping or research. Once you know what you are doing it makes sense to redo everything in C/C++ (or your other favorite static typing language) for production or client use.

I tend to agree. I think the CDF player they made was an attempt to address this, but their commitment to that format has always seemed weak.

Performance is the other issue. Mathematica is no slouch, but it can be tough to figure out how to improve things if you need more speed.

it's really something that needs to be tried in order to be understood properly. imagine jupyter notebooks on steroids, first implemented 30 years ago and improved continuously since then.
One thing people often miss talking about Mathematica is that the core math notebook features, 3d plotting, symbolic algebra tools have all been available since the early 1990s.

Seriously, that's a long time, and a lot of user hours and development have gone into Mathematica. It's not perfect, it's not for everyone, I don't currently have a license, but to my mind, it's the gold standard for interactive notebook type math and science where you will never have to wedge in some weird plugin, deal with a library incompatibility, just go.

> One thing people often miss talking about Mathematica is that the core math notebook features, 3d plotting, symbolic algebra tools have all been available since the early 1990s.

late 1980s to be more precise…

Heavy duty symbolic math, say calculations in General Relativity or Feynman diagrams.
Symbolic algebra. I think you may be confusing numerical scientific computing with symbolic algebra. In the science/math/stats realm the tools you mention (e.g. R and python) do numerical computing. They only have symbolic computing as add-on packages (e.g. sympy). Mathematica is the world's most capable symbolic algebra system by a long way. It can also do numerical operations similar to what R and python can do, but I doubt it has the statistical breadth of R.
(comment deleted)
This is really exciting stuff. Mathematica is by far my favorite environment for doing data exploration and mathematics, and although there is a learning curve, the features of the language itself (pattern matching, symbolic manipulation) are extremely powerful. The quality and depth of Mathematica's documentation are excellent, and with these notebook interface changes things are bound to become even easier. Jupyter + tensorflow/scikitlearn comes close nowadays for machine learning, but I love having access to consistent data sets from within the environment.
Mathematica is squarely on my "stuff I'd buy if I had cash to spare" category. I use Jupyter on a daily basis for a few different languages and it's improving steadily every month, but I kind of wish I was using Mathematica instead most of the time. As it is, I poke at it occasionally on a Raspberry Pi (which is now mostly fast enough) and wonder wistfully what it would be like to run on an i7 (or, rather, a cluster of i7 boxes...)

It does annoy me a bit that it's becoming a mix of a client environment and an online service, but Alpha does have its use.

Not really sure what to make of the Pokémon stuff, though :)

have you tried the free version on the cloud? www.wolfram.com/development-platform/ definitely recommend playing around.
I would use it if it didn't prompt me to upgrade to a paid plan every 10 seconds or so...
:/ yeah, so does youtube and pandora now - 'tis the way of the (commercial) world.
I get that it's commercial. I don't get that they'd want to drive off users upon their first half an hour's usage.
Somehow the mixing of computation and data sources makes me uneasy.

In classical Mathematica, you could be pretty sure that computations with future versions would give the same output. Now what happens when, for example, the average size of an egg increases over time, and then with version 12 the data is updated, and suddenly your notebooks give different results when you rerun them.

Also, where does the data come from? Can you use it as a base for scientific publications?

An even worse problem is that you occasionally lose support for some data entirely. A while back I was playing with some historical stock data and when I went to run the notebook again some time later Mathematica no longer had data for the tickers I was trying to lookup.
But how is that different from having a program that pulls data from an external API or an URL? What if the data changes, the API breaks backwards compatibility or the site just goes offline?

This stuff is packaged nicely, but it's really just another API…

I wonder if any of you use it recreationally, at home. Is it worth buying, assuming you have some spare cash?
No, it's not. Maybe for USD 50, but 300 is far too much when Maxima solves most of the same problems.
(comment deleted)
I'm a Mathematica customer for life. I have been using it for the last 6 years, and I've built only one "big" project in it. I don't like it for "software development", but any time I want to hack something together, or do some calculation, whatever the context, I open a Mathematica notebook. The standard library is astounding, and you're up to speed in no time.
Wish it wasn't so pricy! But I get why. Wolfram alpha's site answers so many of my questions.