An unorthodox introduction to Mathematica!

Before getting into details of what is Mathematica, and why I am writing this post, I should remind about the very interesting lecture by Richard Feynman one of my older posts (here). One of the important message of that lecture was the fact that, naming the so called computer is misleading, as actually no computation is done. Today computers are basically a Fast Filing System. Every software is composed of few definitions for data (string, integer, double, etc) and a set of rules on how to do certain operation. However, nothing internally is making a meaning of those data or the rules. The task of computer is to break down every other programs to the set of those internal rules and data, and finally outputs the result.

Internally all the signs (such as summation, multiplication, devision, etc) has no meaning, and they are just a symbol which imply a rule for data which might come before and after this symbol. This fact is greatly appreciated in one of the earliest programming language, LISP, basically the second oldest language after FORTRAN.

At this point, I should also mention a few words about functional vs imperative programming. Basically, many current programming are imperative programming in a sense that the state of variables changes during the evaluation. However in a pure functional program, nothing is changed and everything is calculated as set of function acting on each other. It is long discussion on what is what, and how is done, and you can see more details here. The bottom line is a more natural (i.e., closest to the real mathematical world) way of programming is the functional way, again such as LISP. Of course, there is always a discussion on being *natural* matters or being *effective*, and so on!

It is so unfortunate that most of current programming languages such as (Java, C/C++, Python, etc) are imperative rather than functional, and most of us are not used to the idea of writing nested functions rather than defining ever-changing intermediate states.

Putting everything together, the best approach which utilize the main capability of “computers” is the language where everything is just a symbol (there is no difference between data and code) and every program is set of nested functions acting on these symbols and finally DISPLAYing the output  in a one way or the other. To make this last point more clear, consider an image, for example, image of a flower. In practice it is wide spectrum of colors DISPLAYED at the pixel of our monitors. These colors are basically numbers which determines the combinations of different primitive colors. So, an image of a flower is no different than expanding a function in terms of some basis.

So the ultimate software which is inline with the internal design of computers is a symbolic functional programming. Mathematica if it is not the only, is the best programming language which is based on those first principles. I should make myself clear, I never claim that Mathematica is implemented the best way possible. What I am trying to achieve here is the fact that Symbolic Functional programming is the best possible way, and Mathematica is in that direction.

One last thing is interesting about Mathematica is the fact that is kind of “Evolutionary programming”. Basically, everyday new functions are added to the main body of the program, and the best one, in terms of speed and quality survives, where the rest of them just fade away. Mathematica is not only a mathematical software, rather and old (and the best) programming paradigm which is rare to find these days.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s