The first count-based programming language, ah, ah, ah!
Every Von program starts with an introduction:
Ah hello there, it is I, the Count!
This is followed by zero or more statements, each on a separate line. The program
then ends with the block-end marker *thunder*
.
For example, this program prints the number 42:
Ah hello there, it is I, the Count!
42! 42 bats, ah, ah, ah!
I love to count bats!
*thunder*
Single-line comments use the π¦ emoji (U+1F987 BAT
).
π¦ This is a single-line comment.
In Von, counting is done using registers. There are two kinds of registers: mutable and constant.
π¦ Mutable
2 Apples, ah, ah, ah!
π¦ Constant
2! 2 Apples, ah, ah, ah!
Mutable registers may be assigned a new value, but it is an error to assign to or redefine a constant register.
Registers are plurality sensitive. That is, if a register is assigned the value 1, the actual register referred to has an 's' appended to it.
1 apple, ah, ah, ah! π¦ 'apples' is now 1
To circumvent this, one may use an exclamation mark, like so:
1 sheep! Ah, ah, ah! π¦ 'sheep' is now 1
One may print the contents of a register either numerically, or interpreted as an ASCII character.
65! 65 apples, ah, ah, ah!
π¦ Numeric
I love to count apples! π¦ Prints '65'.
π¦ ASCII
I love to count apples, ah, ah, ah! π¦ Prints 'A'.
To print multiple registers on one line, use semicolons.
72! 72 horses, ah, ah, ah!
73! 73 images, ah, ah, ah!
I love to count horses; images, ah, ah, ah! π¦ Prints 'HI'.
This piece of code will print 'SPAM' 10 times.
10! 10 loops, ah, ah, ah!
83! 83 sticks, ah, ah, ah!
80! 80 parrots, ah, ah, ah!
65! 65 apples, ah, ah, ah!
77! 77 monkeys, ah, ah, ah!
I count loops:
I love to count sticks; parrots; apples; monkeys, ah, ah, ah!
*thunder*
The following language constructs are not implemented yet. In fact, the designs are not final at all.
1 bat, ah, ah, ah!
1 more bat, ah, ah, ah!
π¦ 'bats' is now 2.
2 more bats, ah, ah, ah!
π¦ 'bats' is now 4.
1! 1 bat, ah, ah, ah!
Are there any bats?
89! 89 yes, ah, ah, ah!
I love to count yes, ah, ah, ah!
*organ music*
78! 78 no, ah, ah, ah!
I love to count no, ah, ah, ah!
*thunder*