
Show HN: Chicken chicken chicken – chicken chicken programming language - torso
http://torso.me/chicken
======
pwg
Except that the name "chicken" is already taken:

google search: "chicken programming language" returns:

#1 Chicken (scheme implementation)
[http://en.wikipedia.org/wiki/Chicken_%28scheme_implementatio...](http://en.wikipedia.org/wiki/Chicken_%28scheme_implementation%29)

#2 CHICKEN Scheme [http://www.call-cc.org/](http://www.call-cc.org/)

~~~
merlincorey
I was also dismayed to find out that rather than being a mainstream post about
my favorite little scheme... I'm greeted by an esoteric language of the same
name.

~~~
James_Duval
It looks fantastic, just the kind of thing I'm looking for - I know Racket
rather than Scheme, though, how different are the two languages?

~~~
ibrow
I read quite a good interview with Chicken Scheme's author a few months ago.
Here's the link which might be of interest:

[http://spin.atomicobject.com/2013/05/02/chicken-scheme-
part-...](http://spin.atomicobject.com/2013/05/02/chicken-scheme-part-1/)

------
bnegreve
Error messages are very clear and understandable which is definitely a plus.
For example:

    
    
        Error on line 1: expected 'chicken'

~~~
jiggy2011
TypeError:

Expected, chicken :

Found, chicken

~~~
laumars
That's got to be the funniest error message I've read

~~~
jiggy2011
You should try Python.

------
angersock
Note that in testing, you'll want to use the semi-minified version of this
language, "cock".

For production, the fully-minified "hen" is naturally preferred.

EDIT: There is a lua implementation available also: 'pollo.

------
delinka
"BBQ: _Chars_ the topmost group of chickens into the corresponding ASCII code.
ASCII stands for American Standard Chicken for Information Interchange."

Dude thought of everything...

------
baggers
Do check out the presentation
([http://youtu.be/yL_-1d9OSdk](http://youtu.be/yL_-1d9OSdk)) as he goes into a
fairy bit of detail on the motivations and implementation of the project.
Fairly moving actually

------
skriticos2
I love how even the JS implementation contains almost only the word chicken
repeatedly.

~~~
h4pless
I like the Chicken he threw in after the return for good measure. Just didn't
have enough chicken without it.

~~~
drv
My JavaScript is a bit fuzzy, but I think those last two lines actually parse
as `return chicken.Chicken;`, so the last Chicken is actually significant.

~~~
h4pless
You're totally right. I was reading it like a sentence. My bad.

------
nater
Once again showing the eerie prescience of The Parking Lot is Full?
[http://www.belligerati.net/archives/chicken.gif](http://www.belligerati.net/archives/chicken.gif)

(Original link to 1996 comic on the PLIF archive is broken, regrettably)

------
cpdean
I'm waiting for the buffalo buffalo port.

------
brudgers
Great prototype. To scale, you will need to implement egg.

~~~
jpreiland
But then he would run the risk of confusing future programmers

"Now, which comes first..."

~~~
brudgers
What matters more is which _ships_ first.

~~~
obviouslygreen
Furthermore, when this is implemented in ObjectiveC, the Apple app store will
require all chicken-chicken-based apps to be fully cooked (and all eggs hard
boiled).

------
sethammons
If this person was _REALLY_ good, they would have changed the word to 'duck'
and used 'goose' as the semi-colon. duck duck duck duck goose

------
perfunctory
The paper actually reminds some blog posts about Ruby or Smalltalk. Just
replace the word chicken with the word object.

------
Schiphol
cool :) But isn't the EOL character a second meaningful symbol in your
language?

------
ricardobeat
Chicken chicken chickens, chicken? Chicken.

~~~
fredley
\--Chicken? --Chicken? --Chicken? --Chicken? --Chicken? --Chicken? --Chicken?
--Chicken? --Chicken?

~~~
obviouslygreen
Syntax error Example usage: chicken -chicken --chicken chicken > chicken

------
girvo
The source code, combined with my utter lack of sleep in the last 24 hours,
caused me to giggle uncontrollably.

------
arbuge
Chicken! Chicken chicken?

//Chicken chicken chicken

chicken (chicken = 0; chicken++; chicken = chicken/0){

    
    
      chicken;
    
    }

~~~
h4pless
chicken = 0 and chicken = chicken/0 are both declarative which will break your
chicken loop. Also, anything divided by 0 is undefined. Try:

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]

------
dodgrile
the word 'chicken' has now lost all meaning.

~~~
alemhnan
[http://en.wikipedia.org/wiki/Semantic_satiation](http://en.wikipedia.org/wiki/Semantic_satiation)

~~~
josscrowcroft
Ahh! This has been happening to me since childhood and I never knew it was a
documented psychological phenomenon. Thanks.

------
DanWaterworth
When can we expect an LLVM backend?

------
ctdonath
I think we have a winner for the next IOCCC (International Obfuscated Chicken
Coding Contest).

~~~
DanWaterworth
That sounds like a difficult competition, how could you make it more
obfuscated? You could implement a BF interpreter.

------
lelf
[https://metacpan.org/module/Acme::Python](https://metacpan.org/module/Acme::Python)

~~~
paulkoer
I have to ask: What does this Acme stand for?

~~~
Vivtek
It doesn't stand for anything - it's the company that Wile E. Coyote orders
wacky equipment from in the cartoons in order to defeat the Road Runner. It's
the namespace in CPAN for joke modules.

~~~
paulkoer
Thank you, I had been wondering about that every now and then.

------
Cthulhu_
hodor?

~~~
JohnLBevan
[http://www.youtube.com/watch?v=oYm6aMMcFu8](http://www.youtube.com/watch?v=oYm6aMMcFu8)

------
mcwhittemore
If Torbjörn Söderstedt would like to explain how chicken.js works - there is
now an open stackoverflow question:
[http://stackoverflow.com/questions/17414435/how-does-
chicken...](http://stackoverflow.com/questions/17414435/how-does-chicken-js-
work)

~~~
torso
There are four statements: 1\. Initialization 2\. Read next character or
bytecode 3\. Conditional, first leg is parsing and second intepretation. 4\.
Return

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.

------
codereflection
I dare say that Brainfuck has a worthy challenger in the category of driving
one insane.

~~~
ISL
At least chicken chicken lacks the active hostility of INTERCAL.

------
joelg236
> Error on line 97: expected 'chicken'

That's hilarious.

------
isawczuk
Write compiler in chicken lang and call it egg.

Then you will solve unsolved puzzle what was first compiler or programming
language. or if you will: chicken or egg.

------
mAritz
The deadfish program sadly stops working after it has run once.

I tried debugging it, thankfully the javascript code isn't minified. I still
failed.

------
gordatron
After about 3 seconds of looking at the source code for the VM I began
wondering if chicken was spelt correctly..

------
trumbitta2
It would be awesome if someone would implement the Hodor programming language,
next.

------
ars
I wonder if he became a vegetarian after managing to write this.

And I bet he has chicken dreams.

~~~
torso
I have more nightmares about what will pass as valid JavaScript.

About being vegetarian: see the BBQ instruction. :-)

------
superpatosainz
SteveBallmer#: A language whose only symbol is "developers".

------
razorsese
That documentation

------
ashishb4u
can someone elaborate the cat program?

~~~
vacri
output = input

------
GhotiFish
chickens was also a valid token.

------
dysinger
Boo for reusing Chicken scheme's name.

