4 ms·
Every time I see something with Wolfram Language, I'm fairly impressed with how powerful it seems. But then I wonder, is that just because I see people who are
by entee 11y ago
Every time I see something with Wolfram Language, I'm fairly impressed with how powerful it seems.
But then I wonder, is that just because I see people who are skilled in the art or is it intrinsic to the language? If it is so powerful, how come I don't see more of it being used? Is this just because it runs on a closed system? So does Matlab, but at least in my experience Matlab seems more widely used, why is that?
- pirate_parrot 11y agoYou can't really compare MATLAB and Mathematica. Mathematica excels at symbolic computation whereas MATLAB is primarily geared towards numerical analysis and scientific computing. You could code numerical things in Mathematica, but you'll get poor performance compared to MATLAB. Similarly, MATLAB does have a symbolic toolbox, but it pales in comparison to the extensiveness of Mathematica. Numerical and scientific computing work is generally more useful in industry than anything you would do with symbolic computation (e.g. you wouldn't analytically solve a sophisticated PDE so you would use numerics), so that explains why MATLAB seems more prevalent. As for your first question, I would say that Mathematica definitely has a lot of power built in. I know a few researchers (myself included) who have used Mathematica in some really cool ways only knowing the basics, which I think is a huge audience for Wolfram. With that said, there are definitely many power users who are probably doing greater things with the language.
- entee 11y agoThanks! Much appreciated :)
- taliesinb 11y ago> You could code numerical things in Mathematica, but you'll get poor performance compared to MATLAB. Yes and no. MATLAB and Mathematica have access to the same BLAS libraries. If you're using packed arrays in Mathematica, you can expect similar performance for many pure numeric things. Mathematica is missing some of the higher level primitives, there's no built-in function that corresponds to DGEMM, as a random example. Another weakness is that there's only a handful of packed array types, for a 64-bit system, you get tensors composed of doubles, signed 64-bit ints, and complex numbers; no bool arrays, no unsigned 32-bit or 16-bit, no enum or factor arrays. Now this is purely a performance thing -- you can make tensors/arrays containing anything you want, but their contents just won't be 'packed' into a contiguous region of memory, instead they'll be arrays of pointers to other memory on the heap. Such arrays are slower to work with, much less memory efficient, harder to pass over an FFI, etc. There's also a lack of fast workhorse-ish functions involving tensors, so there isn't a way to broadcast a condition (say 4 <= x <= 10) onto an input matrix to get a 'mask matrix' as is so common in MATLAB and R and so on, and one of their secrets to writing fastish code in a interpreted language. On the other hand, you can deal with ordinary lists (and Associations) that contain arbitrary types (as with any dynamically typed language), which makes many kinds of algorithmic work very straightforward. After all, not everything is best represented as an n-tensor of reals or ints or bools! But if your lists do happen to be homogeneous lists of ints or reals (of any rank), they will usually end up being stored more efficiently as mentioned above, a process that is, for better or worse, totally invisible unless you know about Developer/PackedArrayQ. There is also Compile (https://reference.wolfram.com/language/ref/Compile.html?q=Compile https://reference.wolfram.com/language/ref/Compile.html?q=Co...) which still has a fairly limited type system, but will still let you bypass large amounts of interpreter overhead when you need to do something performance critical. > you wouldn't analytically solve a sophisticated PDE so you would use numerics The whole analytic/numerical distinction really isn't true anymore (e.g. https://reference.wolfram.com/language/ref/NDSolve.html https://reference.wolfram.com/language/ref/NDSolve.html, https://reference.wolfram.com/language/FEMDocumentation/tutorial/FiniteElementProgramming.html https://reference.wolfram.com/language/FEMDocumentation/tuto...). > so that explains why MATLAB seems more prevalent. I think the explanation lies more with MATLAB having exactly the right features (or the right toolboxes) at the right time to fill niches in thousands of engineering and research labs. If you're running a lab, and that postdoc who wrote the code driving your instrument has long since left, there is very little reason to embrace a new language, even if it has caught up in various ways, and especially if that new language isn't tailored exactly to what you are doing, and would prefer you to use some strange thing called "functional programming", etc.
- chubot 11y agoYeah I think it looks impressive, and it's cool that it's been developed for like 30 years. The Matlab comparison isn't that useful though, because the languages are geared toward different problems. Matlab at its core is linear algebra ("engineering"), while Mathematica is based on symbolic computation ("algebra"). That's a pretty huge difference. They have both branched out I'm sure, but the history remains. People have a similar confusion over Matlab/Julia vs. R. They're both scientific computing, but R is for statistics. (R has matrices and linear algebra, though they are fairly terrible compared to the data frame operations, and seem second class.) I would think of each language as having a core data structure: 1) Mathematica/Wolfram - expression/symbol 2) Matlab - matrix/vector 3) R - data frame (columns of heterogeneous type) Julia is trying to subsume some of R, but it really is almost putting two different (but related) languages under one roof.
- bloaf 11y agohttp://12000.org/my_notes/rankTest/test.htm http://12000.org/my_notes/rankTest/test.htm Mathematica can get performance on par with Matlab. I think the real problem is that Mathematica's performance can feel inconsistent to beginners (i.e. some things are fast, some are slow, and why they are fast and slow is not at all obvious.)
- pirate_parrot 11y agoHmm I don't think that one can conclude much about the overall performance of either pieces of software by this "rank test". It's not exactly comprehensive, nor particularly practical.
- bloaf 11y agoThe benchmarks on http://julialang.org/ http://julialang.org/ have a few more.
- bloaf 11y agoIf I had to guess, its because Matlab looks a lot more like "traditional" programming and so is more approachable to engineers & scientists with a C/Fortran/Basic background. I also think marketing plays a part. Matlab has effectively sold itself as the go-to language for mid-scale number crunching (i.e. scientific-type problems that are complex enough where performance could matter, but not so complex that you need careful performance tuning or a supercomputer.) Mathematica can achieve similar performance in those sorts of problems, but in my mind, Wolfram has been presenting Mathematica as more of an educational/casual tool for one-off tasks. I can't comment on cost or licensing offerings, but that could be a big factor as well.
- contravariant 11y agoIt's powerful but somewhat hard to extend. If there's an intrinsic method to do something then it is very powerful, but if you want to do something slightly beyond the scope of what's already there the code quickly becomes hard to read and slow. It's good for scripts but I really don't see how you could maintain any sizeable project purely in Mathematica.
- iofj 11y ago> It's good for scripts but I really don't see how you could maintain any sizeable project purely in Mathematica. The same is true for MATLAB projects. Yet people do maintain sizeable projects in that. They're horrible, unreadable, and depend on various things in that specific installation of MATLAB that make any even medium sized program hard to even get running on another machine, never mind productionizing it. But lots of people do it.