ZOMBIE


Introduction

ZOMBIE is a programming language designed for Necromancers, particularly evil ones. (Actually, what other sorts are there?) ZOMBIE is an acronym, and stands for Zombie-Oriented Machine-Being Interface Engine.

Design Principles

Language Concepts

Entities

Entities are the main structural units in a ZOMBIE program. They come in several types: The safest entities to use are enslaved undead (thus the focus and name of the programming language). Other entities may be used though, to achieve more complex computing algorithms, but in such cases extra precautions need to be taken.

Threading

ZOMBIE runs in a multithreaded environment. Several entities may be animated at once, and each may perform multiple tasks at once. The relative speeds and orders in which the entities perform tasks is undefined, and should not be relied on by the programmer.

Entities and their tasks may be active or inactive. An active entity is one which has been animated, disturbed, or is free-willed. A zombie or ghost that has been summoned and bound is inactive. An active task is one that has been animated; an inactive task is one that has been bound, or that the entity has completed.

All the active entities in a ZOMBIE program process their active tasks.

Comments

Syntax Elements

ZOMBIE programs are in the form of a list of entity declarations. Entities may be declared in any order, and declarations are completed before any entities are activated.

Note that syntax errors in ZOMBIE programs can be extremely dangerous, especially if demons or djinn are invoked. These spirits may escape the CPU and wreak havoc in the outside world without the correct binding commands. The language author recommends all computers running ZOMBIE code be surrounded by correctly inscribed pentagrams or other protective seals.

Data Values

Data values are free format arithmetic or string expressions, conforming to standard rules. Typing is weak. String and numeric values are converted implicitly as required, in a "sensible" manner.

Undead can remember exactly one data value, either numeric or string. If multiple copies of the same entity are invoked, they all remember the same data value - if one copy remembers a new value, the value remembered by all copies changes to the new value.

Entity Declaration

Entities are the basic elements of a ZOMBIE program. Valid ZOMBIE programs must declare at least one entity.

Entities are declared with the following structure:

entity-name is [a|an] entity-type { entity-statements }

Entity-type is one of the following:

Entity-name is any well-formed identifier string.

Entity-statements is a list of any valid statements, which may include entity declarations.

Entity Declaration Statements

Some statements delineate matched pairs, which may be nested to any level. All the following combinations are properly matched pairs: The following statements are used to declare entities:

Task Statements

These instruct the entity to do various tasks. They can be considered to be written and parsed in reverse-reverse-Polish notation. i.e. each statement has a temporary data stack, which can hold both data and entities. Values are added to the data stack beginning at the end of the statement, and working back to the beginning. For example, the statement
remember Zombie1 moan Zombie1 moan Zombie2
works like this:
  1. Put Zombie2 on the stack.
  2. moan causes the top stack element, Zombie2, to be replaced by its remembered data value.
  3. Put Zombie1 on the stack.
  4. moan causes the top stack element, Zombie1, to be replaced by its remembered data value.
  5. Put Zombie1 on the stack.
  6. remember causes the top stack element, Zombie1, to remember the sum of all elements in the stack.
The following task statements are defined in ZOMBIE. They all instruct the entity on top of the data stack to do something. If the top value on the data stack is not an entity, the calling entity is the one that does the command.

Flow Control

Operators

Sample Programs

Hello World

HelloWorld is a zombie
summon
	task SayHello
		say "Hello World!"
	animate
animate

Fibonacci Numbers

Zombie1 is a zombie
summon
	remember 1
bind

Zombie2 is a zombie
summon
	remember 1
bind

FibonacciZombie is a zombie
summon
	remember 0
	task SayFibonaccis
		shamble
			say moan Zombie1
			say moan Zombie2
			remember Zombie1 moan Zombie1 moan Zombie2
			remember Zombie2 moan Zombie1 moan Zombie2
			remember moan 2
		until remembering 100
	animate
animate

Resources


Home | Esoteric Programming Languages
Last updated: Wednesday, 08 February, 2006; 00:40:42 PST.
Copyright © 1990-2014, David Morgan-Mar. dmm@dangermouse.net
Hosted by: DreamHost