Mathematica (Mma) demonstrates that almost all of mathematics can be reduced to pattern-substitution. Wolfram's business plan to provide the very best algorithms available for all mathematical applications, and to integrate that capability with almost all computational environments is, well, wonderfully astonishing.
I began writing Mma code in 1988, using a pre-release beta copy. Fracturtles was the first significant program that I wrote. It ran immediately in the 2005 version of Mathematica 5.1 (a tribute to Wolfram, not to my code!)
FRACTURTLES Fracturtles provides an algebra of drawings that can be used for succinct description of complex scenes, for compression of drawings, and for construction of scene templates. This implementation is a prototype with limited expressability, only two-dimensional line drawings can be constructed. Path composability, however, permits construction of extremely complex drawings from very simple descriptions.
Paths can be composed additively simply by joining two or more path specifications "in the same space". This results in a spatial concatenation of drawings. Paths can also be composed multiplicatively, every unit line of one form is expanded to the entire shape of a second form. This results in recursively complex drawings, and can be used to construct generalized template abstractions of drawings. A fractal is a path that is recursively composed with itself an infinite number of times.
The linked version is a Mma notebook that has yet to be converted into legitimate Mma notebook format. There is a minor bug in handling complex multiplication specifications that I'll clean up sometime soon (Jan 2006).