4 ms·
I'm always amazed by how expressive Mathematica is. Writing some of these expressions imperatively would be significantly more than one line.
by tsomctl 9y ago
I'm always amazed by how expressive Mathematica is. Writing some of these expressions imperatively would be significantly more than one line.
- fjsolwmv 9y agoThese are mostly just API calls with arguments, with some simple lambdas. You can implement that in any language.
- maliker 9y agoI think the magic of Mathematica is the combination of (1) a huge collection of well-maintained CAS and math functions (2) great graphics and animation support (3) the notebook interface (which jupyter is catching up on fast) and (4) some of the best documentation in the industry. Modifying the Mathematica code after its written, however, is very tricky.
- sizzzzlerz 9y agoWhat you said plus the accuracy and precision to which results are computed. They're effectively limited only by the amount memory you have and your patience. And even patience isn't required unless you're calculating pi to trillions of digits. It's really fast.
- blt 9y agoEven if some of the components in Mathematica are not state-of-the-art, there's a huge synergy benefit from having everything together in one environment, using the same datatypes. I think that's the big benefit of Mathematica and Matlab. Python can match (or exceed) a lot of their capabilities but you spend all this time with package managers, converting data types, etc.
- brianwawok 9y agoWhat is this time with package managers? Takes an hour one time to learn pip and virtualenv. Then its 1 pip command to install a package.
- aisofteng 9y agoAn hour? I'd say about five minutes.
- tsomctl 9y agoWhen I say Mathematica, I mean both the language and the functions they provide.
- cgmg 9y agoThen again, all code is 'just' a bunch of RAM instructions, which can be implemented in any (Turing-complete) language. That doesn't tell us anything about how elegant or expressive it is.
- goldenkey 9y agoMathematica is functional. So..you can but you can't. Expressiveness..its a virtue, and Mathematica offers it through being a pattern matched, lazy binding, functional language, with both lexical and block scope, with amazing operators built in for the basic data types. Shameless plug: https://scrollto.com/the-generalized-mean-an-algorithmic-approach/ https://scrollto.com/the-generalized-mean-an-algorithmic-app... The code could maybe be written in another language but the fact that Mathematica allows for unbound variables and has beautiful functional library calls like Fold, make it very elegant to write once and work with almost any arguments. Wolfram Cloud is free and Mathematica has a trial, if you did want to fool around. Mathematica is written in C++, it would be nice to see Wolfram head in the direction of having it produce binaries. It could become a major language of general development if that ever became the case. But Wolfram has always been very "particular" with his goals. One can dream...
- eggy 9y agoI love Mathematica too, so I bought the Home edition. I play in a lot, but at work and home I keep J open [1]. It has a shell and an IDE of sorts if you want it. Something like the geometric mean in your article is: #%:/ define it as gm =: # %: / # is tally or number of terms %: is root * multiply / apply over or map gm 1 100 10 It also has plot libraries, graphics and is very fast for an interpreted language. Perfect for math and statistics. I do like the curated data available to Mathematica, and WL or Wolfram Language is able to be coded functionally, imperatively, or any way you might want. [1] jsoftware.com
- goldenkey 9y agoThe main point of the code was to create new means and show derivation of known means. It's easy to write a geometric mean in any language. Having the solve function in Mathematica makes it possible to do dynamically generated means that wouldn't be possible in languages without a strong CAS library. Also, will J error out on gm a b ? or gm a 100? The beauty of Mathematica is that I can still get results results in algebraic form, when I leave variables unset. In:= GeneralizedMean[{x, y, z, t}, (#*#2) &] Out= (t x y z)^(1/4)
- henrikeh 9y agoI’ve been toying with an idea for a while. Mathematica/Wolfram is a surprisingly interesting language from a design p.o.v. — everything from the Lisp origins, syntax sugar, syntax highlighting and formatting, all the things mentioned in another comment etc. I’ve been thinking about writing about some of these details and how other languages and editors could be inspired. Anybody who thinks there might be interest?
- Chris2048 9y agoYep!
- amelius 9y agoI'm surprised that they didn't choose a purely functional language for Mathematica.
- goldenkey 9y agoDon't know why you are being downvoted. Mathematica is a pattern matching language. You set downvalues or upvalues usually. It does have functional syntax and functional methods but the base of it is pattern matching. That contributes to its rather poor performance and necessity to use Compile for C level perf. Most likely Wolfram was inspired by a couple other CAS being developed around the time he started developing Mathematica.