Show HN: Chicken chicken chicken – chicken chicken programming language
torso.me
torso.me
google search: "chicken programming language" returns:
#1 Chicken (scheme implementation) http://en.wikipedia.org/wiki/Chicken_%28scheme_implementatio...
#2 CHICKEN Scheme http://www.call-cc.org/
http://spin.atomicobject.com/2013/05/02/chicken-scheme-part-...
It might be funny to also have a 2 symbol language called 'duck duck goose' where statements are terminated by 'goose' or something. I can't see any confusion between that and, say, duck duck go either!
Error on line 1: expected 'chicken'Expected, chicken :
Found, chicken
For production, the fully-minified "hen" is naturally preferred.
EDIT: There is a lua implementation available also: 'pollo.
Dude thought of everything...
(Original link to 1996 comic on the PLIF archive is broken, regrettably)
"Now, which comes first..."
Um, I mean patent chickens, of course.
Chicken chicken, chicken chicken. Chicken chicken chicken chicken: "Chicken". Chicken chicken chicken chicken chicken chicken Chicken chicken.
"Chicken chicken chicken" [1]
Chicken chicken, chicken chicken!
[1] Chicken
(CHICKEN: Chicken chicken chicken chicken!)
For those who don't have idea: http://www.youtube.com/watch?v=lIpev8JXJHQ
//Chicken chicken chicken
chicken (chicken = 0; chicken++; chicken = chicken/0){
chicken;
}chicken(chicken = 0; chicken < chicken/chicken; chicken++){
chicken chicken;
}Which in pure chicken chicken would be:
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken
chicken
[Edit: Add chicken chicken interpretation]
When parsing, the function will call itself recursively as chicken(linenumber, 0). When interpreting, it calls itself as chicken(undefined, undefined). With the second parameter 0 or undefined, the initialization code will not run again. With the first parameter undefined, it will run the interpreter instead of the parser. (It is important that the line number is non-zero.)
This is where the implementation gets a bit ugly. There's no way of preventing the interpreter from running. That means the error message must form valid bytecode. It does this by setting the stack pointer to -1 and returning an array of length two. The interpretation starts at index 2, which will be read as undefined and thus interpreted as the axe instruction (halting the program). sp will have been increased to 0 by the initialization and thus points to the error message at index 0 in the array, which will be returned as the result. (The second value in the array is unused, and was only inserted to avoid using a parenthesis.)
That should hopefully clear up the big picture. Some small notes:
Comparing input and code during initialization should always be false. When negated, it produces the value 0.
The value after && that follows the comparison with "n" is always true. It was just a way to avoid a parenthesis.
CHICKEN ++- CHICKEN produces -1. The side effect isn't used.
That's hilarious.
Then you will solve unsolved puzzle what was first compiler or programming language. or if you will: chicken or egg.
I tried debugging it, thankfully the javascript code isn't minified. I still failed.
And I bet he has chicken dreams.
About being vegetarian: see the BBQ instruction. :-)