dev-master
9999999-devChicken VM written in PHP.
MIT
The Requires
The Development Requires
by Igor Wiedler
chicken chicken-vm
Wallogit.com
2017 © Pedro Peláez
Chicken VM written in PHP.
, (*1)
PHP implementation of the Chicken VM, ported from JavaScript., (*2)
What is Chicken? It's a language based around one single symbol: chicken.
Actually, there are a few tokens: chicken, space and newline. The chicken
count of a line corresponds to an opcode., (*3)
It roughly translates into a form of assembly. The supported operations are
chicken (string), +, -, *, ==, load, store, jump, chars and literal
numbers., (*4)
The memory model has pointers to the stack itself and input as the first two elements of the stack. Those are followed by the opcodes, delimited by 0. The opcodes then run until the 0 is reached, at which point the head of the stack is returned. Every operation consumes one or more elements, then pushes its result onto the stack., (*5)
The reference implementation is written in JavaScript and is a piece of art., (*6)
chickenLow-level chicken interpreter., (*7)
Quine:, (*8)
$ echo chicken | bin/chicken
Cat:, (*9)
$ echo chicken | bin/chicken foo <<EOF chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken EOF
To enable debug logging of instructions and stack, pass the --debug option:, (*10)
$ echo chicken | bin/chicken --debug
eggsembleEggsembler. Compiles down to chicken., (*11)
Print A:, (*12)
$ (bin/eggsemble | bin/chicken) <<EOF push 5 push 13 rooster bbq axe EOF
chickenasmCompiles ChickenASM to eggsembly., (*13)
Print A:, (*14)
$ (bin/chickenasm | bin/eggsemble | bin/chicken) <<EOF push 5 push 13 multiply char exit EOF
Count:, (*15)
$ cat examples/count.cha | bin/chickenasm | bin/eggsemble | bin/chicken 3
99 chickens:, (*16)
$ cat examples/99chickens.cha | bin/chickenasm | bin/eggsemble | bin/chicken 9
ChickenASM is a different dialect of chicken assembly. This tool allows translating to eggsembly., (*17)
Chicken VM written in PHP.
MIT
chicken chicken-vm