Bartosz Witkowski - Blog.
Home About me

Arthur C. Clarke famously said that “Any sufficiently advanced technology is indistinguishable from magic.”

This was, perhaps, recognized by Hal Abelson and Gerald Jay Sussman in their introduction to Computer Science. The introduction mentions that “the so called Computer Science has a lot common with magic”, and their book Structure and Interpretation of Computer Programs is often called The Wizard Book due to the wizard on it’s jacket.

Unfortunately, we seldom try to view technology through the prisms of magic. Which is a shame as technology is exactly as exciting as magic of fantasy books and mythology.

This blog post tries exploring a question: what if we perceived technology as we do magic? What if we seriously thought ourselves to become wizards? Is analyzing technology through prism of magic useful?

Magic as Advanced Technology

I will use the term magic as any description of the supernatural - whether be it religious miracles or non-religious ideas like spells or myths. Historically, only a subset of such magical beliefs had any relation to technology as we understand it today with some notable1 exceptions.

Greek mythology2 has one of the first descriptions of automation as well as the first description of robots e.g. the living statues of Daedalus, Hephaestus’s automatons of which Talos was the first description of an autonomous robot or autonomous turret. Other early sources of automatons could be found in medieval legends of the brazen head and in Jewish folklore about the golem.

Medeia and Talos by Sybil Tawse

A depiction of Talos by Sybil Tawse

Possibly due to their shared ancestry with logic, both technology and law often finds common parables in folk tales about sorcerers3.

A particularly salient example of a connection between magic and technology are the various incarnations of stories about unchecked infinite loops such as the Sorcerer’s Apprentice, The Magic Porridge Pot, or The Water Mother. The Sorcerer’s Apprentice in particular touches upon not only non-termination but also fork bombs - idea’s that are eerily familiar to programmers.

Variants of the Faustian legends which feature quibbles are also of some interests to technologists. Polish folk tales tell the story of Twardowski a sorcerer who like Faust made a deal with the devil. Going into the contract with the intention of never fulfilling it he adds a condition to the contract that the devil may only take his soul in Rome - which only finally happens when he enters a inn named after the city giving an early example why expressive type systems can reduce accidental errors.

Magic Systems

In fantasy (games or literature) magic is sometimes presented in a magic system4.

Magic system are the rules and laws magic must follow in a given setting. Settings vary in the level of detail of their magic systems, and how magic in a peculiar setting interacts with the physical world. Sometimes settings will have multiple magic systems interacting with one another (e.g Allomancy and Feruchemy in Brandon Sanderson’s Mistborn series) - in such cases I will refer to them as schools of magic5.

Unfortunately, describing or even listing the plethora of magic systems that were imagined by authors and game designers would be impossible, so I’ll concentrate on those that seem particularly relevant.

In general, magic systems seem to have three things in common:

  1. A limit to who can perform magic:
  2. How magic is limited6 in interaction with the physical world and how one interfaces7 it, how it actuatates the world or the what’s domain of magic:
    • observation without manipulation e.g auguries, farseeing, telepathy, various other forms of ESP
    • effects inside one’s body (shapeshifting, regeneration, Feruchemy)
    • controlling supernatural forces or beings which may or may not influence the physical world (various incantations of summoning; controlling of spirits, dijns, demons or devils; the pokemonesque magic of Codex Alera).
    • controlling or manipulation of some limited domain of the physical world:
      • classical elements and/or metals (Avatar the Last Airbender, the various furies of Codex Alera, Allomancy, the elementalist archetype).
      • light and/or shadows: The Plague of Darkness from the bible, the unlight of Ungoliant from Tolkien’s legendarium, drafting from Lightbringer.
      • communication or control of other entities (sometimes to supernatural levels): the beastmaster archetype, Wit from Robin Hobb’s Realm of the Elderlings, nature magic archetype, mind control.
      • creating supernatural artifacts, potions or other consumables: alchemy archetype, artificiery archetype of which artificiery of Elves from The Lord of the Rings is the most famous example.
  3. What is the cost of performing magic?
    • some sort of magical energy (mana, spirit, power points in most RTS, RPG or TRPG games)
    • lifespan (e.g. Sorcery from Master of Five Magic), blood or other corporal sacrifice (e.g. magic of Canim ritualists from Codex Alera)
    • consumption of raw materials (alchemy, Allomancy)

Having those generalities in mind let’s take a look at some concrete magical systems.

Vancian magic

One of the first well defined8 magic systems was described in Jack Vance’s The Dying Earth published in 1950 .

In this system magic is based on casting spells. Each spell must be fully memorized9 before casting and once used is spent completely and must be memorized again before reusing. The human mind has a limited capacity for memorizing spells - the number of spells one can remember is a proxy for the mage’s power and more powerful spells are more difficult to remember. Spells have very specific effects and are usually very powerful (e.g teleportation, slowing time, supernaturally increasing the stealth of a target) but the knowledge of all the spells and the ability of creating them has been lost and wizards go out of their way to procure “forgotten” spells. Everybody can learn and cast spells but only those calling themselves wizards specialize in it.

The Vancian magic system inspired many more magic systems in particular the one in the original Dungeons and Dragons10 and it in turn was a huge influence on, arguably, the most famous magic system: the magic system behind Magic the Gathering.

But before I go into the details of Magic the Gathering, I wanted to mention its other important influence the magic system described in Lyndon Hardy’s Master of the Five Magics, published in 1980.

Master of the Five Magics

The magic in Master of the Five Magics is divided into five schools

While Master of the Five Magics is a relatively unknown nowadays, it is cited as a direct thematic influence of the last magic system I wanted to describe in greater detail.

Magic the Gathering

Magic the Gathering (MtG) originally released in 1993 is a collectible card game in which players armed with their own personal and customizable card decks play out a series of duels between each other.

Each card in the player’s deck represent lands (sources of mana) or spells: summonable creatures; artifacts; fire-once sorceries like death spells or fireballs; long lasting enchantments; or so called instants - cards that can be played in response to other player’s spells11.

Players have a deck of cards to draw called the library, and drawn cards form their hand. Cards in the hand can be played after playing their cost for it’s instantaneous effect in case of sorceries and instants, or so called permanents: lands, creatures, artifacts and enchantments can be played into the play area called the battlefield where they’re able to influence the game. Spent spells and destroyed permanents go into a designated discard pile known as the graveyard.

Like in Master of Five Magics, the magic system of MtG is divided into five schools called colors with colorless artifacts arguably comprising the sixth school. Each color has in-game mechanical strengths, weaknesses and limitations on what it can do12 as well as thematic and ideological ones, this division is sometimes called the color wheel. Colorless artifacts are a way to add strengths of other colors to your own deck at a higher cost than in their native color.

Magic the Gathering play areas

Magic the Gathrering play areas. Copyright by PMendezOrtiz, CC BY-SA 4.0, via Wikimedia Commons

White

The school of order, peace and light but not necessarily good but good in it’s own mind. White is the color of collectivism and it’s focus is on conformity, religion, law and structure.

Spells focus on healing or preventing damage, protecting and augmenting the player as well as guarding against power: mechanically with destruction spells that can only target powerful summons; taxing the opponent each time he plays some card type; or board wipes; as well as the ability to destroy enchantments (long lasting rules that would get in white’s way).

Creatures associated with white are soldiers, captains, samurai but also angels or pegasi and gargoyles.

Tactics of white usually include overwhelming the opponent with creatures, boosting them with enchantments and/or controlling the opponent by removing taxing him or removing his most powerful creatures.

Blue

The school of logic, manipulation and trickery, the desire to know the world’s secrets, mastering possibility and essence.

It’s focus is on thinking and strategy, manipulating time and information; it’s the color of illusion. Mechanically, this is emergent in the focus on blue on card drawing, counter spells, stealing opponent’s cards, discarding opponent’s cards from the library, returning permanents to hand, activating spent and deactivating unspent cards.

Creatures associated with blue usually have an aquatic theme because blue’s power comes from Islands - but philosophically thematic creatures include dijns, faeries, shapeshifters, spirits, illusions and sphinxes, wizards and artificers.

Tactics of blue include stalling the opponent by denying him actions either by countering the opponent’s spells, returning costly cards to hand, deactivating cards or destroying the opponent by discarding his entire library (so called milling).

Black

Black is the school of death, corruption and sacrifice but it’s not necessarily evil and closer to amoral. Black is the color of selfishness, anarchism, mercilessness.

The spells from this school concentrate on parasitism, infiltration, destruction of creatures, various forms of “deals with the devil”, resurrection. Mechanically, black is the color that can leech the life from a creature or opponent to boost the player, look and discard opponent’s cards, destroy creatures and play cards from graveyard. Deals with the devils are ways of sneaking costlier cards at the cost of life or sacrificing the player’s own resources.

Creatures associated with black consist of zombies, skeletons, vampires, werewolves, wraiths, liches but also imps and demons.

Tactics of black include stalling the opponent by denying him cards; aggressive decks which damage the player almost as much as they damage the opponent; reanimator or dredge decks which concentrate on populating the graveyard and then playing reanimated cards at a lessened cost.

Red

Red is the school of chaos, fury and warfare. This color exemplifies recklessness, rage, emotion, unpredictability.

The spells from this school concentrate on tempo, direct damage (in contrast to destruction), boosting attacks, destroying of artifacts and lands.

Stereotypical creatures associated with red are goblins, dragons, efretti, orcs, phoenixes and salamanders.

It’s tactics are based around fast and aggressive plays with cheap creatures and cards that damage the opponent directly.

Green

Green - the school of life, nature, evolution. Green is the color most in tune with nature.

The spells from this school concentrate on artifact and enchantment destruction, creating new creatures (mechanically via tokens), life gain, mana production, regeneration, and temporary boosts.

Green creatures are usually animals or mythic creatures such as bears, wolves, wyrms, hydras but also dryads and elves.

Green tactics are based around mana generation and playing big creatures to pressure the opponent.

Influence

MtG spawned the entire collectible card game genre13, many Magic the Gathering video games and was a direct influence on many other computer games like Master of Magic14 or Hearthstone and concepts from the game cross pollinated to many countless media.

Other Magic Systems

Vancian, Master of the Five Magics and MtG are only the top of the iceberg.

It is worthy to note that popular culture amplified tropes from myth, fantasy and gaming giving us a rich magical vocabulary and archetypes that sometimes transcends historical or mythological understanding of those words.

Most of us associate druids with peaceful nature based magicians and not Celtic religious figures, necromancers are associated with magicians that can control the dead and not augurers.

So What Can Magic Teach Us?

After this rather long winded exploration of magic I would like to state the main theses of this article.

  1. Magic, myths, and fantasy can be thought as Gedankenexperiments - a point appreciated by fantasy writer R. Scott Bakker
  2. While mathematics, the natural world and other branches of engineering should be the primary source of inspiration for technologists - magic, while being considered the opposite of science, is, funnily enough, not totally unrelated to technology and would make a good secondary (or tertiary) source of inspiration. Meditating on The Sorcerer’s Apprentice or demonology would be more insightful than say ballet, target shooting or cocktail making.
  3. Magic might also be a source of motivation and appreciation. Technology is a part of everyday life but thinking about the wonderful accomplishments of man which are no less spectacular than something that was pure fantasy just centuries ago makes one appreciate how fare we’ve come. While thinking yourself a wizard might make you sound a bit special15 stepping away from computer science, automation or quality control and working on a fun project inspired by your favorite fantasy book would be a good way to get out a slump.

Technology as a Magical System

Going back to the common elements of all magic systems we can see that technology can be viewed through that lens.

  1. Who can perform magic - anyone can take advantage of technology but creating new technology takes learning in specific domains like computer programming, engineering, biochemistry.
  2. Technology’s limitations are the limitations of the natural world - because if there’s anything that Mother Nature hates more than anthropomorphizing her - it’s breaking her laws.
  3. The costs of technology are physical - electrical energy, raw materials, chemical reagents - as well as mental in the sense that mastery and practice of engineering (or programming, chemistry etc) usually involves mental labor.

In essence, and with full apologies to Niklaus Wirth:

Superhuman Ability + Automation = Magic

And since technology is magic it can be used for wondrous ends.

Is Voyager not an example of far-seeing? Communication across billions of kilometers only possible because of Shannon’s insight into the nature of information. On a shorter scale but not less impressive are the achievements of computer vision researchers which can use visual input to successfully predict motion and audio beyond lines of sight.

And what’s video streaming if not remote viewing? What’s Zoom or Skype if not telepathy? Mathematical, statistical and machine learning models along with appropriate sensors are used to forecast weather, the behavior of markets, and customer demand - nothing short of auguries.

Computer numerical control, Computer aided engineering and Computational Fluid Dynamics are the technological analogues to artificiery.

The idea of automaton is one of the most persistent ideas of magic there is and at this point in time the field of robotics and it’s commercial applications is so wide that I’m sure everybody can find their own favorite one. The robots of today resemble simple machines making them closer to the Sorcerer’s Apprentice broom. But by studying insect minds, biological designed organisms16, and programmable droplets which is just a subset of Microfluidics we are surely getting closer to reimplementing Galatea.

Robot Vacuum

The dream of every Sorcerer's Apprentice - automated robot vacuum.

The pursuit of Artificial General Intelligence (AGI) and the possible emergence of superintelligence is not unlike demonology, deals with the devil or summoning djins.

In fact AI ethicists speculate about super-intelligence based purely17 on fictional narratives alone18 . my speculation is that we only have concerns about AGI due to sheer amount of thought experiments in fiction (either fantasy and magic, or science fiction).

In 2007 Wired described the experiment of Peter König in what could be called esp: a vibrating belt which allowed the wearer to sense North was fitted to a test subject. In time the subject learned to integrate the newfound sense of direction into his perception of reality; today Mr König’s research is being applied to studies in helping the blind and visually impaired navigate! The field of augmented reality and biofeedback can also be understood through the esp lens, albeit with different goals.

What Color is Your Function?

Programming, computer science and in a more general sense computer systems, are mainly focused on meta-magic or what MtG aficionados would understand by blue magic:

If we take the idea of “programming is blue magic” further, the control archetype mostly associated with blue would imply the existence of computer systems that force wasting resources. Something that fits both Bitcoin and the Lotus-eater nature of computer games.

The question arises: do other colors from the MtG color wheel have their technological counterparts?

Since the domain of green magic is nature, it’s also perhaps the easiest one to find examples of:

And since the domain of red is damage, examples come almost as easy as green:

For a very long time I couldn’t find a convincing example of black magic (in the MtG sense) that isn’t simply a Trojan horse or a covert listing device, luckily, the scientists from Rice University came to my aid by repurposing spider cadavers to create robotic grippers. If that isn’t an example of black magic I don’t know what is.

White is the color of order, law and peace. Finding examples of white technology (in the MtG sense) was also easy but the examples are much more controversial:

The idea that

“[White is] not necessarily good but good in it’s own mind

rings particularly true when one summarizes what can be though of as white technology. And even if you’re not thinking about white magic - you can bet someone else is.

Can Programming Be Liberated from the Blue Style of Magic?

Being a programmer I was made painfully aware how restricted my domain is while writing this article. Studying programming languages, algorithms and data structures, data bases, computer graphics, computer vision leaves one with solid foundations of meta-magic or Blue magic - but nothing above that. Only AI can be thought as something more.

Yet most universities and even programming sites will concentrate on the above.

What Computer Science education needs is more cross pollination with other branches: robotics, bioinformatics, engineering, law but also gardening or farming, woodworking, machining, chemistry, medicine.

What we definitely don’t need are very opinionated but not much researched opinions on “variable naming”, “SOLID design principles”, “why is X better than Y”. And why are you spending most of your time learning frameworks?

Parting Thoughts

I didn’t want this blog post to be an incomprehensible laundry list of cool but unrelated things, so my hope is that I’ve managed to at least keep the spirit, if not the contents, uniform.

It’s easy to go overboard with analogy and find similarities where there are none - falling for spurious correlations or wholesale conspiracy theories is as easy as allowing oneself to not look at the entire set of facts.

While some magic is similar to some technology we can’t really communicate with ghosts nor time travel. There’s nothing in technology that’s close to Tolkien’s song of creation and while creating gold from lead is technically possible nobody is going to earn a living this way soon.

Even analogy in magic itself sometimes breaks down - reading up about MtG’s color wheel I was struck how Black is the color of “treachery”, even though thinking about it it seemed more like a Blue quality and I had serious doubts how to classify technological robotic weapons20 - is this artificiery? Is this Black because it kills or Red because it’s used for damage?

Does it matter?

The analysis in this article was somewhat tongue in cheek and, although I think I spent an unhealthy amount of time obsessing about examples, the exact mechanisms aren’t exactly important - technology is technology and observes precise rules in its respective fields (programming, robotics, biochemistry etc) but the analogues only serve as imprecise models.

For me and every programmer21 reading this, I hope this post will serve as motivation to spend some time doing something fun instead of reading about the next framework, startup, and finally go beyond Blue style of magic!

Footnotes

  1. Possibly due to survivor bias. 

  2. Ancient Greece was also the hotbed of real historical technological advancement like pneumatic clocks of Ktesibios and the steam engine of Heron

  3. Especially where legalism is concerned. 

  4. The alternative of not describing the rules of magic is sometimes called soft fantasy and this was also how magic was understood (or not understood) in myths and legends. 

  5. Even in cases where the magic is not learned in schools but is innate. 

  6. The idea of limits distinguishes magic from omnipotence. 

  7. I.e. by performing a ritual, only concentrating, speaking magic incantations, writing out runes etc. 

  8. Or rather the first one I could trace down. 

  9. E.g by reading it from a spell book. 

  10. Although as written the system was pretty rudimentary 

  11. To a first approximation. Describing the exact rules of Magic: the Gathering is beyond the scope of this article. 

  12. E.g destroying artifacts was traditionally only possible in red and green colors, destroying enchantments in white, destroying any creature in black, counterspells were the domain of blue, while direct damage the red. 

  13. Showing a funny example in cross-pollination in fantasy gaming. Lord of the Rings was a direct influence on Jack Vance’s writing as well as Dungeons and Dragons (which was also inspired by LotR) which in turn inspired Magic the Gathering which led to the creation of a two card games based on The Lord of the Rings - The Lord of the Rings Trading Card Game and *Fantasy Flight Games: The Lord of the Rings the Card Game**

  14. In some ways the system of magic in Master of Magic (MoM) works even a better as an analogy than MtG since MoM was a game with diplomacy and economics due to it being a 4x game and not a 1v1 duel. Green spells in MoM would increase production or terraform the world map, white color spells would target diplomacy and were able to manage unrest in a city. 

  15. Unless you’re Hal Abelson or Gerald Jay Sussman and are in fact a wizard. 

  16. Making it an example of a construct from Wheel of Time or biological magic of Tekne from R. Scott Bakkers’ The Second Apocalypse

  17. Which isn’t a dig - in the absence of any real AGI one can only speculate. 

  18. Sometimes to a ridiculous degrees: https://www.lesswrong.com/tag/rokos-basilisk 

  19. Coincidentally, the symmetry between white magic/black magic in hacking is also visible in the terms for people hacking into computer systems for good white hat versus evil black hat

  20. The design space of MtG understands that colors are somewhat similar to one another in its concept of allied color i.e another i.e black is allied to blue and red as they share similar characteristics. In a way the author of How the ‘Magic: The Gathering’ Color Wheel Explains Humanity might be right that the color wheel is a wrong-but-useful personality type test. And like a personality type’s it’s useless to obsess about. 

  21. Non programmers are already doing fun and useful stuff!