3 ms·
Despite the overwhelming sense of ego that pervades every word Wolfram and his organization ever writes, you owe it to yourself to try Mathematica. When I had
by snprbob86 14y ago
Despite the overwhelming sense of ego that pervades every word Wolfram and his organization ever writes, you owe it to yourself to try Mathematica.
When I had first encountered Mathematica in college, I thought "this is neat", used it for a few calculations, and forgot about it. Fast forward to a few months ago and I decided to install a demo just to learn about term rewriting and pattern matching.
What I discovered blew my mind: It's just a lisp! Every expression has a "head", which is just a namespaced symbol. FullForm[x+y+z] is really just Plus[x,y,z] and Head[Plus[x,y,z]] is simply Plus. Squint, and it looks like (+ x y z) to me... The really interesting part is that the entire computational library is built around term rewriting. While there is mutable state, it exists almost primarily at the symbol definition level. Everything else is pretty much pattern matching on trees of symbols. Even the rendered output is just a drawn representation of a box-oriented markup built out of Mathematica forms. It's quite amazing.
- bitwize 14y agoWasn't Wolfram the guy who said that Lisp was completely inadequate for mathematical computing, being too slow by a factor of 100 or summat? Mathematica owes much of its lineage to Macsyma, a computer algebra system that really was Lisp on the inside; its spiritual descendant, Maxima, is written in CL.
- snprbob86 14y agoWolfram seems to have a penchant for hyperbole. However, at the time, that was likely true. My understanding is that v1 of Mathematica really was just a rewrite of Macsyma in C.
- taliesinb 14y agoI suspect you are thinking of SMP, which was Wolfram's first attempt at a symbolic language: http://en.wikipedia.org/wiki/Symbolic_Manipulation_Program http://en.wikipedia.org/wiki/Symbolic_Manipulation_Program
- tzs 14y agoSource for the following: personal recollection from when I was an undergraduate at Caltech. I had a part time job as a systems programmer/admin at CITHEP (Caltech High Energy Physics), mostly dealing with their VAX-11/780, at the time that Wolfram was using that machine to develop the predecessor or Mathematica. Wolfram and Chris Cole started developing a symbolic math system, which they named Symbolic Manipulation Program (SMP), when they found that Macsyma was unable to handle the computational needs for their physics research. For problems that they considered to be medium problems, Macsyma could do the work, but it was very slow. For problems that they considered to be large problems, Macsyma ran out of memory. Thus, they needed something more efficient in both time and space. Wolfram and Cole planned on writing in C. They asked researchers in the symbolic computation community about this, and were told that it was a terrible idea. C was too low level. To do a high level system like a symbolic algebra system, you had to work at a much higher level. Using anything less than Lisp pretty much guaranteed your project would take forever. Wolfram and Cole decided on C anyway. (BTW, C at CITHEP was not quite standard C. Norman Wilson had hacked the compiler to handle float and double expressions the same way FORTRAN handled them, making C almost as good as FORTRAN for numerical work, and C had mostly taken over from FORTRAN for physics computation there). I recall seeing the factor of 100 number, or something like that, in one of the first public presentations of SMP. On the research problems that Wolfram and Cole considered to be medium sized, SMP was beating the Lisp-based systems by around a factor of 100.
- phren0logy 14y agoThanks very much for that. This is one of the reasons I love Hacker News!
- vsbuffalo 14y agoLisp is too slow? I find this hard to believe. SBCL is incredibly fast, allows run-time compiling, and if you dig in the source, actually is partially written in assembly for speed. That's in part why Duncan Temple-Lang and Ross Ihaka suggested it as a base for a new R implementation a while back (http://lambda-the-ultimate.org/node/3726 http://lambda-the-ultimate.org/node/3726).
- fusiongyro 14y agoLisp isn't too slow, but it was too slow at one time. The old joke was "Lisp programmers know the value of everything and the cost of nothing."
- taliesinb 14y agoYup, it's basically a LISP. And it has a kind of polymorphism (using UpValues) that makes it possible to do something akin to OOP. Here's the beginnings of a set implementation in Mathematica: SortedSet[x_List] := SortedSet @@ Union[x]; SortedSet /: Plus[a_SortedSet, b_SortedSet] := Union[a, b]; SortedSet /: Plus[a_SortedSet, Minus[b_SortedSet]] := Intersection[a, b]; Format[set_SortedSet] := AngleBracket @@ set; Now you can use + and - on these sorted sets, and they'll format in the frontend as SortedSet[Range[3]] -> <1, 2, 3>. And part indexing, MemberQ, FreeQ, and pattern matching will Just Work.
- patrickgzill 14y agoThings similar to lambda calculus, look like lambda calculus?
- ustcscgy 14y agoWell, there is a expression that mathematica can not Integrate[] it, but AXIOM can. integrate((x/sqrt(x * x * x * x + 10 * x * x - 96 * x - 71)),x) AXIOM is written in lisp and latex (literate programming), it's more powerful than MAXIMA.
- deleted 14y ago[deleted]