My projects and thoughts

Chicken specification

Every line in the program is inspected for chickens, and the corresponding number of chickens are pushed onto the stack. Execution is done directly on the stack, which may make the program susceptible to arbitrary chicken injection attacks.

Instructions

#NameDescription
0axeTerminates all chickens.
1chickenPushes "chicken" onto the stack.
2addAdds the two topmost groups of chickens.
3foxTurns the topmost group of chickens into foxes. The foxes will subtract one chicken each from the second topmost group and eat them. Note that it is possible to end up with a negative amount of chickens. It may work arithmetically, but as it doesn't make sense it should be considered undefined behavior.
4roosterCauses the two topmost groups to multiply. This instruction also works arithmetically, but it ought to work in a way that makes more sense for chickens in future versions.
4.5fenceDivides chickens. In some circumstances it is possible to end up with partial chickens. As there is no other way to do that, it isn't possible to use this instruction.
5compareRemoves the two topmost groups of chickens from the stack, checks if they are equal, and pushes either a truthy or a falsy chicken instead.
6pickThe topmost group of chickens are interpreted as an address. This is a double wide instruction that uses the next group of chickens to determine what to load from: 0 for loading from the stack, 1 for loading from input. Any other value is usually undefined.
7peckThe topmost group of chickens are interpreted as an address. The second topmost group of chickens get stored at that address on the stack.
8frFlies to a different instruction if the condition is truthy. (Chickens have wings and don't need to jump.) The topmost group of chickens are interpreted as a relative offset. The second topmost chickens are the condition.
9BBQChars the topmost group of chickens into the corresponding ASCII code. ASCII stands for American Standard Chicken for Information Interchange.
nPushes n-10 chickens onto the stack.