Symbolic Programming
Wolfram Language comes with a vast standard library that is well-suited for most problem-solving tasks—similar to what Python or Julia are used for.
The complexity of many utility tasks, such as plotting data over a given range, can be comparable to the simplicity of Microsoft Excel.
Wolfram Language is a symbolic programming language, which in essence means:
- Code and data are expressions.
- Computation is driven by applying rules.
- What you see is just one form of interpretation.
Introduction
Let’s take a look at a simple example:
Integer numbers are atoms of the language on which we can apply transformation rules. We can also use more general patterns:
What you see as:
Is actually represented in the code editor as:
(*FB[*)((1)(*,*)/(*,*)(2))(*]FB*)
Looking closely, it’s still the same (1/2)
expression, but wrapped in special comment blocks that tell the editor how to render it.
Any output expression is editable and can be reevaluated.
Let’s go further and apply a more advanced rule:
As you can see, Wolfram Language does not distinguish between data types. Colors, numbers, functions—they are all just symbolic expressions.
You can also format output for readability:
More complex styling:
This creates an array of numbers and highlights primes.
Symbolic features also apply to Graphics:
It may look like an image, but it’s not.
Everything is a set of Wolfram expressions decorated with rendering metadata. Underneath, it’s still real code.
Most symbols are abstract representations that can be interpreted in many ways.
This also applies to 3D graphics:
It’s all about interpretation.
Let’s take a symbolic object like Cuboid and compute its volume:
Images are expressions too. Try dragging an image into the editor:
Then manipulate it, for example:
Analyze color distribution in LAB space:
Working with matrices is just as symbolic:
Still behaves like a regular matrix:
Use the Command Palette to draw matrices quickly.
You can even combine symbolics with stylistic expressions:
Syntax sugar also helps represent abstract objects:
Even something like DateObject
is visually formatted:
Time series also render visually:
Learn how to create such objects:
Preview palettes visually:
Play audio inline:
Too much data? Use icons:
These are stored with zlib
compression and encoded in base64. If the content exceeds a few KB, it gets offloaded and referenced instead.
These are built-in features. There's no privilege granted to system code that you can't use yourself. You can build your own symbolic objects with syntax sugar and styling.