

The Software Engineering of Mathematica - lf6648
http://reference.wolfram.com/mathematica/tutorial/TheSoftwareEngineeringOfMathematica.html

======
numlocked
"...the user-level design of Mathematica has remained compatible from Version
1 on. Much functionality has been added, but programs created for Mathematica
Version 1 will almost always run absolutely unchanged under Version 6."

I wonder if this is the case because of dedication to backwards compatibility
or because the original syntax was based on some fundamental mathematical
concepts that are sound and thus don't change the same way most APIs do. Can
anyone with more Mathematica experience weigh in?

~~~
Adrock
The syntax is heavily influenced by M-expressions, which were used for the
original version of Lisp in McCarthy's papers [1]. I believe the purity and
power of the syntax is a major factor in the stability of the language.

I spent the summer of 2000 interning at Wolfram. I wrote coverage tests for
over 60,000 lines of the Mathematica source code in areas ranging from
functional programming operations to advanced numerical functions. My
experience was that the source code was incredibly clean and well organized
across the board.

[1] <http://en.wikipedia.org/wiki/M-expression#Variants>

~~~
scrumper
I didn't understand as much as I'd have liked of the linked article. Let me
check something. In Mathematica, are the M expressions the internal 'FullForm'
representations of expressions? So, for example, I type:

    
    
        a = {1,2,3};
    

Which is represented internally as an 'M expression' of List[1,2,3]
(obtainable through FullForm[a], or its head through Head[a])?

Is that it?

I didn't realise that was a named concept. It does make sense to have a
completely unified internal representation underneath the syntactic sugar,
since you'd need everything to be in that form for the term rewriting system
to work.

Thanks!

~~~
Adrock
Yes, and for completeness I'd like to point out that this doesn't just apply
to the right-hand side of the equation you gave. The "=" is just syntactic
sugar to let you do variable assignment using infix notation:

In[1]:= FullForm[Hold[a={1,2,3}]]

Out[1]//FullForm= Hold[Set[a,List[1,2,3]]]

~~~
scrumper
Worth pointing out, thanks! I see how that works.

------
elteto
This just one part of a longer series: The Internals of Mathematica [1].
Overall a very interesting read.

[1]
[http://reference.wolfram.com/mathematica/tutorial/TheInterna...](http://reference.wolfram.com/mathematica/tutorial/TheInternalsOfMathematicaOverview.html)

------
sn6uv
Mathics has about 25K lines of python of which only about 10 lines are
platform specific. There are also about 100K lines of JS, but much of it is
automatically generated or libraries. Admittedly it is missing lots of the
features of Mathematica, but I think its an interesting comparison to make.

Disclaimer: I'm a developer for Mathics

~~~
gajomi
This looks cool. I am a big fan of the sympy's lightweight/modular approach to
computer algebra, and so its great to see work on a nice front end. I have one
random question. What was the rationale behind having "Apply" overwrite the
head of an expression? If a function "f" takes a list to a list and I call
"Apply[Plus,f[x]]" I would like the result to have "Plus" as the new head with
"f[x]" as the tail. But as it it it feels like mixed semantics. Is there
something I am missing?

------
dmlorenzetti
An interesting aspect of this is the "dogfooding" that seems to take place
under Mathematica's covers. The internals use many of the same representation
and communication techniques as are exposed to users.

------
mumrah
"Mathematica is one of the more complex software systems ever constructed"

Wolfram, et al really thinks they are hot shit.

~~~
B-Con
Yeah, they/he has that attitude. But to be fair, they kind of are. They power
the most advanced computing software for the public, and they're a strong
dependency for Siri.

------
MikeKusold
This is an interesting series. I've always been fascinated with Matlab and
Mathmatica ever since I took a class on floating point precision errors in
college. I hope one day I get to work on a program that requires those
algorithms to be used.

------
austinlyons
+1 for champaign il devs

