It is also the name of a programming language I am developing to address the lack of Eastern philosophy in the current set of commonly used languages such as C and Java. The meanings of "haifu" all describe essential qualities of the language.
Note: The specification for Haifu is not quite complete. I don't think it's quite enough as it stands to be a fully-featured programming language. It's not likely I'll ever return to finish it off, however.
Even numbers have Yin quality, while odd numbers have Yang quality. Floating point numbers have the quality of the number they are "reaching for" (i.e. they are treated as if rounded away from zero; 1.2 is Yin, -2.3 is Yang).
When a Haifu program is executed, all non-comment words and punctuation marks are placed in order into the Celestial Bureaucracy. Hyphenated words are treated as a single word. When all the haiku have been thus processed, the Bureaucracy contains all words of the code, with the first word nearest Heaven and the last word furthest away. The Celestial Bureaucrat (language interpreter) then processes the words beginning at the bottom rung, ascending one rung at a time, until the Bureaucrat reaches Heaven (i.e. is "above" all the words in the Bureaucracy), at which point the program terminates. The Celestial Bureaucrat does not occupy positions in the Bureaucracy, but merely looks at the words.
The Celestial Bureaucrat has a Delegate to help him. The Delegate also begins looking at the bottom rung of the Bureaucracy, but only ascends or descends on the direct orders of the Celestial Bureaucrat. Additionally, no matter what orders are given to the Delegate, he may never rise to a position higher than the Celestial Bureaucrat - if such an order is given, the Delegate merely rises to the same level as the Celestial Bureaucrat.
Integer literals may be specified by writing the number in English, in either cardinal (one, two, three) or ordinal (first, second, third) form. Additionally, common synonyms for numbers are accepted: "no", "none" for zero, "a", "an" for one, "couple" for two, "dozen" for twelve, "century" for one-hundred, etc. A literal which forms a single number must be hyphenated together, otherwise it will be treated as two numbers: "two hundred" is 2 followed by 100, "two-hundred" is 200. Numbers, especially long ones, may be hyphenated across lines and/or haiku to maintain proper haiku structure. The size of integers specifiable is governed by the artistic problems inherent in filling an entire haiku with just a number.
Random numbers may be generated using words such as "some", "few", "many", etc - which evaluate to suitable random integers whenever encountered by the Celestial Bureaucrat or Delegate.
Floating point literals may not be specified and can only be generated by operating on integers. If a floating point number is required to be interpreted as an integer (for Unicode output, for example), it is treated as the number it strives for (see the Yin/Yang section).
All number literals are reserved words in Haifu. All number literals are initially of Earth elemental quality.
If the Celestial Bureaucrat encounters a numeric literal, it is beneath his dignity and he ignores it and ascends to the next rung of the Bureaucracy.
Variables may contain a sequence of orders remembered by the Celestial Bureaucrat. The remembering of orders is discussed under "Punctuation" below.
Note that when a variable name is placed into the Bureaucracy it is the variable itself, not just its value. A variable may fill multiple roles in the Bureaucracy, and thus appear in it many times at different levels of enlightenment. If the value or elemental nature of the variable changes, the change applies to all roles in which the variable finds itself. This may confuse unenlightened Western programmers, but those in harmony with the Tao realise there can be no other way and bend as the willow to the requirements.
If the Celestial Bureaucrat encounters a variable, it performs the sequence of orders it has remembered as the definition of that variable. If the variable has not yet been defined, the Bureaucrat does nothing and ascends to the next rung of the Bureaucracy.
If any order specifies an operation which makes no sense, the Bureaucrat ignores it and ascends to the next rung of the Celestial Bureaucracy.
heaven/nirvana/enlightenment/harmony:
This causes the Celestial Bureaucrat to ascend to Heaven immediately
(thus terminating program execution).
promote/more/increase/wax:
This causes the Celestial Bureaucrat to ascend a number of rungs equal to
the number or numeric variable at the Delegate's rung. If the Delegate's item is not a number or variable containing
a number, this operation does nothing.
demote/less/reduce/wane:
This causes the Celestial Bureaucrat to descend a number of rungs equal to
the number or numeric variable at the Delegate's rung. If the Delegate's item is not a number or variable containing
a number, this operation does nothing. If the Celestial Bureaucrat descends below the Delegate, the Delegate also descends to
the same level as the Bureaucrat.
blossom/flower/petal:
This causes the Delegate to examine the Yin/Yang value of the item at his rung.
If it is Yin, the Celestial Bureaucrat descends a number of rungs equal to the numeric vaue of the Delegate's item. If it is
Yang, the Celestial Bureaucrat ascends that number of rungs. If the item does not have a numeric value (and thus is neither
Yin nor Yang), this operation does nothing.
rise/float/ascend/up:
This causes the Delegate to move up a number of rungs equal to the number or numeric
value of a variable in the rung immediately below the Celestial Bureaucrat. If the rung below the Bureaucrat does not contain such
a number, the Delegate moves up one rung. In either case, the Delegate may only rise as high as the same rung as the Bureaucrat.
fall/drop/descend/down:
This causes the Delegate to move down a number of rungs equal to the number or numeric
value of a variable in the rung immediately below the Celestial Bureaucrat. If the rung below the Bureaucrat does not contain such
a number, the Delegate moves down one rung. If the number is greater than the number of rungs below the Delegate, he falls to the
very bottom of the Celestial Bureaucracy.
listen/hear/see:
This is an input command which causes a number or unicode character on the standard input
stream to be read and inserted as the bottom-most value on the Celestial Bureaucracy. If no input awaits, this command takes the
word in the rung above the Celestial Bureaucrat and "reads" it by removing it from that position and putting it at the bottom of
the Bureaucracy.
speak/say/draw:
This is an output command which causes the Delegate to output the number or numeric value of
a variable at his rung to the standard output stream as a Unicode character. If the number is outside the legal
range for Unicode, or the Delegate's item is not a number or variable containing a number, this operation does nothing.
count/number/age:
This is an output command which causes the Delegate to output the number or numeric value of
a variable at his rung to the standard output stream as a number. If the Delegate's item is not a number or variable containing
a number, this operation does nothing.
create/produce/build:
This causes the Delegate to change the elemental quality of the number or numeric-valued
variable at his rung to the quality of the element that its current quality creates.
destroy/damage/kill:
This causes the Delegate to change the elemental quality of the number or numeric-valued
variable at his rung to the quality of the element that its current quality destroys.
fear/hate/doubt:
This causes the Delegate to change the elemental quality of the number or numeric-valued
variable at his rung to the quality of the element that its current quality fears.
love/desire/regard:
This causes the Delegate to change the elemental quality of the number or numeric-valued
variable at his rung to the quality of the element that its current quality loves.
become/reach/achieve:
This causes the Delegate to change the value of any variable or number literal in his
rung of the Bureaucracy to become the number it strives to be. This will round a floating point value to the next integer further
away from zero, increment a positive integer, and decrement a negative integer. Because a zero value strives for nothing, it becomes
enlightened and the variable or literal is transformed to the word "nirvana". This operation also changes the elemental quality of
a variable to the element created by its current quality, but does not assign an elemental quality to a literal. If the word to
be operated on is not a variable or number literal, this operation has no effect.
like/as/is/resemble:
This causes the variable in the rung immediately below the Celestial Bureaucrat to take the
value of the first variable or number encountered by the Delegate as the Delegate searches from his current rung downwards. The
Delegate then moves to the location of the variable or number found. If no variable or number is found, the Delegate remains at his
current rung and assigns the value of zero to the variable.
tomorrow/today/yesterday:
negative/not/deny:
This causes the Delegate to change the sign of the number or numeric-valued variable at his
rung.
operate/examine/study:
This causes the Delegate to perform a mathematical operation on the values of
the two numbers or variables in his rung and the one just above it. The operation is defined as follows, where A is the value
one rung above the Delegate, and B is the value of the Delegate's item:
Elemental Relationship | Operation |
---|---|
B creates A | A+B |
B destroys A | A-B |
B fears A | A/B |
B loves A | A*B |
B is the same element as A | Yang if both A and B are Yang, Yin otherwise |
As in all good programming practice, comments are used to elucidate sections of code, provide extra syllables for syntactic integrity, and make poignant observations on the nature of life and the ephemeral qualities of beauty. Comments may span haiku, and may be several haiku long if the programmer has something particularly insightful to say about the code or the universe in general.