Roger Germundsson
Major new approaches to programming happen rarely and, when they do, they are often absorbed slowly. With the object-oriented programming approach to software design now widely adopted, the world seems ready for another, even more dramatic change–symbolic programming.
With the object-oriented programming approach to software design now widely adopted, the world seems ready for another, even more dramatic change: symbolic programming.
|
This methodology has now reached the point where it can be put to use immediately, enabling a new generation of computing throughout engineering.
To be sure, symbolic programming is only a recent phase in the evolution of computing, but it has a lengthy heritage, encompassing mathematics, logic, and computation theory. Numbers, it is said, were first used by the Babylonians at least 4000 years ago. But in the 16th century a key discovery was made: one could represent an entire calculation by an algebraic formula and, furthermore, one could generate new formulas by following certain rules.
This idea led to the development of calculus and all of its applications, and subsequently to symbolic logic and universal computing–the foundation of modern computers. All mainstream computer languages since Fortran (short for Formula translation) have absorbed the idea of using formulas. But in the process, the idea that formulas can be manipulated to generate new formulas was left behind, abandoning much of what had been achieved in mathematics over the last 500 years. One of the objectives of Mathematica, a symbolic programming language first developed 10 years ago, was to make such achievements readily available.
But in building the infrastructure needed to manipulate formulas, one creates something much more general. The same ideas needed to support formulas also let one specify engineering structures, user interfaces, and much more, in a form where they can be manipulated as formulas.
In Mathematica, for example, the generalization of a formula is a tree or expression which, when written out linearly, is of the form f[e1,...,en] where each ei is itself an expression. Absolutely everything in this language is represented in the same uniform way.
For example, if you type x+y z, the language treats it as Plus[x,Times[y,z]]. Other examples include programs (While[p,e]), graphics (Polygon[p]), documents (Notebook[e]), typesetting (FractionBox[n,d]), and interface (ButtonBox[b]). You can extend this approach to represent any system; so Circuit[{Resistor[r],Capacitor[c]}] could represent the series connection of two circuit elements. Applications have been written that extend the symbolic language in this way for optical, electrical, mechanical, and many other kinds of systems.
With all objects represented in a uniform way, computing reduces to just one fundamental operation: transforming one expression to another
|
With all objects represented in a uniform way, computing reduces to just one fundamental operation: transforming one expression into another. Such uniformity makes it possible to mix different programming styles, just as it lets different domains of engineering and mathematics be combined.
When you solve a differential equation using symbolic programming, you can give input just as on paper, without manual reduction to "computer friendly" form. Then you can get not only numerical results, but also closed form solutions, perhaps including parameters that can be further manipulated, that is, optimized, solved for, and so on.
Programs can be manipulated symbolically and used, say, to generate C++ code. Notebook documents can be produced directly by programs, allowing automatic document generation. Communication of arbitrary structures with external programs becomes possible using expressions and such open protocols as MathLink. This permits symbolic programming interfaces with systems like Excel or Word; the calling of, say, Java or Fortran code; and even parallel processing.
Forty years into the evolution of programming languages, the idea of symbolic programming has finally made it possible to incorporate the achievements of many centuries of mathematics and logic and to build a strong platform for a new, much richer, kind of technical computing.
Roger Germundsson is director of research and development at Wolfram Research Inc., Champaign, Ill., makers of Mathematica. Previously he was with the Automatic Control Division, Linköping University, Sweden, and the Information Systems Laboratory, at Stanford University, in California.
Originally published in IEEE Spectrum, January 1999. Reprinted with permission.