Skip to Main Content

Iconic Programming

Iconic programming involves writing programs that resemble what they do, through the prominent use of icons – a kind of “resemblance-oriented programming”, if you will.

Fact

In semiotics, a distinction is made between icons and symbols. Symbols signify what they reference through convention, while icons signify through resemblance.

This distinction is associated with the American philosopher Charles Sanders Peirce.

Symbols and icons

Unlike icons, symbols are abstract. They don’t necessarily resemble any concrete thing. Their meaning emerges through convention, as in the everyday rules of a language.

There is nothing about the following set of symbols that immediately suggest a circle. If we are familiar with some conventions in geometry, English and JavaScript then we can nonetheless interpret that drawBigCircle(3) will draw a circle of radius 9.

let drawBigCircle = (r) => {
   draw.circle(r**2)
}

Pointers are pointy

In a letter to his wife from 18701, Peirce used simple illustrations to convey what he encountered in his European travels, including Mount Etna, the craters of which are themselves small mountains.

Peirce’s letter with drawings of a mountain and a cactus

The ^ in Peirce’s drawings is iconic. It resembles the wide base, steep sides and narrow peak of a mountain.


Icons can also bear a resemblance to a non-physical concept.

The Odin language uses ^ for its pointers:

pointer_to_int: ^int

In C, * is instead used:

int *pointer_to_int

The Odin documentation states as justification:

Odin borrows the ^ syntax for pointers from the Pascal family, because it is pointy […]

– my italics

The syntax for pointer in Odin and Pascal resembles the concept of what a pointer does: it is pointy because it points2.

Neither language is fully iconic, as they use combinations of both symbols and icons. The mnemonic and expressive benefits if icons can be leveraged without a wholesale adoption of an iconic language.

Sand falls down

Icons can be used to write programs where the input resembles the output. The following syntax is from SPLAT:

@ => _
_    @

It is a rule: if a particle is above empty space it will fall into that space. The @ is a particle and the _ is empty space.

In the more accessible SpaceTode – a “spatial programming language” inspired by SPLAT – this rule yields a visual output: particles that fall.

Taken together, the set of characters is itself iconic: the rule resembles the causal event that it generates

The creators of SPLAT (Dave Ackley) and SpaceTode (Lu Wilson) rightly emphasise the spatial aspect of their work, but I also think resemblance is a salient characteristic.

Comments illuminate

In APL, comments are prefixed with the or “lamp” symbol:

⍝ this is a comment

The intention is that comments illuminate the code. Comments should resemble a (metaphorical) illumination, rather than — for example — a mere recapitulation. This icon is a reminder to the programmer, but not a guarantee of illumination.

Like Odin and Pascal, APL is not strictly iconic, as it contains a mixture of icons and more abstract symbols, often borrowed from mathematics. If you find APL code inscrutable, it’s probably not solely owing to its use of icons.

⍝ for illumination: https://xpqz.github.io/learnapl/aplway.html

⍉2∘⊥⍣¯1⍳2*3

Iconic programming and visual programming

Visual programming is often contrasted with conventional, text-based programming. Visual programs typically rely on graphical elements (boxes, nodes, blocks), which can be dragged and connected. These interfaces can be more convenient for specific users or for particular use-cases.

In semiotic terms, icons resemble what they represent, yet the concept of “resemblance” is not only visual.

Mary resembles her father in her temperament

The stimulatory effects of coffee resemble that of tea

All games share a family resemblance with each other

The dog-owner’s hand gesture resembles the action he expects of the dog

Consider also that:

  • Programming visually/graphically does not require any icons. The most common building blocks are nodes and edges, which are fundamentally abstract.

  • Programming with icons does not require a graphical user interface. I can type or write ^ ^ ^ to represent a mountain range without a GUI.

  • Programming with icons does not require a spatial interpretation. Prefixing a comment with is a subtle reminder that its effect should resemble a process of illumination.

Here are some icons that I can type, and how they might be interpreted in a given domain:

  • ^ pointer
  • ! filter
  • () container
  • (()) nested container
  • o loop
  • # grid
  • / gradient
  • @ atom

Why icons?

I might like to program with icons because they have an immediate conceptual similarity to what I am trying to make. I might like to leverage this similarity while still using a keyboard and plain text. Whether such a language is readable or effective depends on the language design.

A needless multiplication of symbols does not need to necessarily result. One difficulty would be in selecting a finite set of icons for highly generalisable ideas. Ideas like parthood, connection and enclosure are highly general, span many contexts and can be combined in many ways.

A language does not need to be fully iconic, but can leverage icons to make abstract concepts more concrete. An excellent example here is the use of the pointy ^ for pointers in Odin and Pascal.

Important

Just as pointers can be pointy, pipes can be…pipey.

In Unix, the | or “pipe” is used to compose a pipeline of commands.

cat log.txt | grep "error" | sort | uniq

The | seems to resemble a pipe, although I could not find any evidence of this being a reason for its original selection.


There is something powerful about the idea of “resemblance”. How can programs be made to look and feel more like what they do? What important non-visual resemblances exist and how can they be represented?

References

Notes

  1. Nubiola, J., & Barrena, S. (2012). Drawings, Diagrams and Reasonableness in Charles S. Peirce’s Letters during his First Visit to Europe (1870-71). In Das bildnerische Denken: Charles S. Peirce. Retrieved draft version from https://www.unav.es/gep/Nubiola&BarrenaDrawings.pdf on Fri Apr 25, 2025

  2. The meaning of an icon depends on the context of its use. We can use ^ to represent a pointer to a memory location or to represent a mountain.


Details
6 minutes
Table of Contents