<s>
Chicken	O
(	O
stylized	O
as	O
CHICKEN	O
)	O
is	O
a	O
programming	O
language	O
,	O
specifically	O
a	O
compiler	B-Language
and	O
interpreter	B-Application
which	O
implement	O
a	O
dialect	O
of	O
the	O
programming	O
language	O
Scheme	B-Language
,	O
and	O
which	O
compiles	B-Language
Scheme	B-Language
source	O
code	O
to	O
standard	O
C	B-Language
.	O
It	O
is	O
mostly	O
R5RS	B-Language
compliant	O
and	O
offers	O
many	O
extensions	O
to	O
the	O
standard	O
.	O
</s>
<s>
The	O
newer	O
R7RS	O
standard	O
is	O
supported	O
through	O
an	O
extension	O
library	B-Library
.	O
</s>
<s>
Chicken	O
is	O
free	B-License
and	I-License
open-source	I-License
software	I-License
available	O
under	O
a	O
BSD	B-Operating_System
license	I-Operating_System
.	O
</s>
<s>
It	O
is	O
implemented	O
mostly	O
in	O
Scheme	B-Language
,	O
with	O
some	O
parts	O
in	O
C	B-Language
for	O
performance	O
or	O
to	O
make	O
embedding	O
into	O
C	B-Language
programs	I-Language
easier	O
.	O
</s>
<s>
Chicken	O
's	O
focus	O
is	O
quickly	O
clear	O
from	O
its	O
slogan	O
:	O
"	O
A	O
practical	O
and	O
portable	B-Architecture
Scheme	B-Language
system	O
"	O
.	O
</s>
<s>
Chicken	O
's	O
main	O
focus	O
is	O
the	O
practical	O
application	O
of	O
Scheme	B-Language
for	O
writing	O
real-world	O
software	O
.	O
</s>
<s>
Scheme	B-Language
is	O
well	O
known	O
for	O
its	O
use	O
in	O
computer	B-General_Concept
science	I-General_Concept
curricula	O
and	O
programming	O
language	O
experimentation	O
,	O
but	O
it	O
has	O
seen	O
little	O
use	O
in	O
business	O
and	O
industry	O
.	O
</s>
<s>
Chicken	O
's	O
other	O
goal	O
is	O
to	O
be	O
portable	B-Architecture
.	O
</s>
<s>
By	O
compiling	B-Language
to	O
an	O
intermediate	B-Application
representation	I-Application
,	O
in	O
this	O
case	O
portable	B-Architecture
C	B-Language
(	O
as	O
do	O
Gambit	B-Language
and	O
Bigloo	B-General_Concept
)	O
,	O
programs	O
written	O
in	O
Chicken	O
can	O
be	O
compiled	B-Language
for	O
common	O
popular	O
operating	B-General_Concept
systems	I-General_Concept
such	O
as	O
Linux	B-Application
,	O
macOS	B-Application
,	O
other	O
Unix-like	B-Operating_System
systems	I-Operating_System
,	O
Windows	B-Application
,	O
Haiku	B-Language
,	O
and	O
mobile	O
platforms	O
iOS	B-Application
and	O
Android	B-Application
.	O
</s>
<s>
It	O
also	O
has	O
built-in	O
support	O
for	O
cross-compiling	B-Application
programs	O
and	O
extensions	O
,	O
which	O
allows	O
it	O
to	O
be	O
used	O
on	O
various	O
embedded	B-Architecture
system	I-Architecture
platforms	O
.	O
</s>
<s>
Like	O
many	O
Scheme	B-Language
compilers	B-Language
,	O
Chicken	O
uses	O
standard	O
C	B-Language
as	O
an	O
intermediate	B-Application
representation	I-Application
.	O
</s>
<s>
A	O
Scheme	B-Language
program	O
is	O
translated	O
into	O
C	B-Language
by	O
the	O
Chicken	O
compiler	B-Language
,	O
and	O
then	O
a	O
C	B-Language
compiler	B-Language
translates	O
the	O
C	B-Language
program	I-Language
into	O
machine	O
code	O
for	O
the	O
target	O
computer	B-General_Concept
architecture	I-General_Concept
,	O
producing	O
an	O
executable	O
program	O
.	O
</s>
<s>
The	O
universal	O
availability	O
of	O
C	B-Language
makes	O
it	O
useful	O
for	O
this	O
purpose	O
.	O
</s>
<s>
Chicken	O
's	O
design	O
was	O
inspired	O
by	O
a	O
1994	O
paper	O
by	O
Henry	O
Baker	O
that	O
outlined	O
an	O
innovative	O
strategy	O
to	O
compile	B-Language
Scheme	B-Language
into	O
C	B-Language
.	O
A	O
Scheme	B-Language
program	O
is	O
compiled	B-Language
into	O
C	B-Language
functions	O
.	O
</s>
<s>
These	O
C	B-Language
functions	O
never	O
reach	O
the	O
return	O
statement	O
;	O
instead	O
,	O
they	O
call	O
a	O
new	O
continuation	O
when	O
complete	O
.	O
</s>
<s>
These	O
continuations	O
are	O
C	B-Language
functions	O
and	O
are	O
passed	O
on	O
as	O
extra	O
arguments	O
to	O
other	O
C	B-Language
functions	O
.	O
</s>
<s>
They	O
are	O
calculated	O
by	O
the	O
compiler	B-Language
.	O
</s>
<s>
So	O
far	O
,	O
this	O
is	O
the	O
essence	O
of	O
continuation-passing	B-Application
style	I-Application
.	O
</s>
<s>
Baker	O
's	O
novel	O
idea	O
is	O
to	O
use	O
the	O
C	B-Language
call	B-General_Concept
stack	I-General_Concept
for	O
the	O
Scheme	B-Language
heap	O
.	O
</s>
<s>
Hence	O
,	O
normal	O
C	B-Language
stack	O
operations	O
such	O
as	O
automatic	O
variable	O
creation	O
,	O
variable-sized	O
array	O
allocation	O
,	O
and	O
so	O
on	O
can	O
be	O
used	O
.	O
</s>
<s>
When	O
the	O
stack	O
fills	O
up	O
(	O
that	O
is	O
,	O
the	O
stack	O
pointer	O
reaches	O
the	O
top	O
of	O
the	O
stack	O
)	O
,	O
a	O
garbage	B-General_Concept
collection	I-General_Concept
can	O
be	O
initiated	O
.	O
</s>
<s>
The	O
design	O
used	O
is	O
a	O
copying	B-General_Concept
garbage	I-General_Concept
collector	I-General_Concept
originally	O
devised	O
by	O
C	B-Language
.	O
J	O
.	O
Cheney	O
,	O
which	O
copies	O
all	O
live	O
continuations	O
and	O
other	O
live	O
objects	O
to	O
the	O
heap	O
.	O
</s>
<s>
Despite	O
this	O
,	O
the	O
C	B-Language
code	O
does	O
not	O
copy	O
C	B-Language
stack	O
frames	O
,	O
only	O
Scheme	B-Language
objects	O
,	O
so	O
it	O
does	O
not	O
require	O
knowledge	O
of	O
the	O
C	B-Language
implementation	O
.	O
</s>
<s>
In	O
full	O
,	O
the	O
Scheme	B-Language
heap	O
consists	O
of	O
the	O
C	B-Language
stack	O
as	O
the	O
nursery	O
together	O
with	O
the	O
two	O
heaps	O
required	O
by	O
the	O
generational	O
garbage	B-General_Concept
collector	I-General_Concept
.	O
</s>
<s>
This	O
approach	O
gives	O
the	O
speed	O
of	O
the	O
C	B-Language
stack	O
for	O
many	O
operations	O
,	O
and	O
it	O
allows	O
the	O
use	O
of	O
continuations	O
as	O
simple	O
calls	O
to	O
C	B-Language
functions	O
.	O
</s>
<s>
Further	O
,	O
Baker	O
's	O
solution	O
guarantees	O
asymptotic	O
tail	B-Language
recursive	I-Language
behavior	O
,	O
as	O
required	O
by	O
the	O
Scheme	B-Language
language	I-Language
standard	O
.	O
</s>
<s>
The	O
implementation	O
in	O
the	O
Chicken	B-Language
Scheme	I-Language
compiler	I-Language
is	O
even	O
asymptotically	O
safe	O
for	O
space	O
.	O
</s>
<s>
Chicken	B-Language
Scheme	I-Language
is	O
mostly	O
R5RS-compliant	O
,	O
with	O
a	O
few	O
notable	O
limitations	O
and	O
deviations	O
.	O
</s>
<s>
R7RS	O
compatibility	O
is	O
supplied	O
as	O
an	O
extension	O
library	B-Library
.	O
</s>
<s>
An	O
extension	O
library	B-Library
exists	O
which	O
adds	O
support	O
for	O
full	O
UTF-8	O
awareness	O
.	O
</s>
<s>
Chicken	O
has	O
a	O
large	O
software	B-Application
repository	I-Application
of	O
added	O
libraries	O
and	O
programs	O
,	O
termed	O
eggs	O
.	O
</s>
<s>
This	O
system	O
is	O
very	O
similar	O
to	O
RubyGems	B-Application
.	O
</s>
<s>
Currently	O
,	O
eggs	O
can	O
be	O
developed	O
anywhere	O
and	O
under	O
any	O
version	B-Architecture
control	I-Architecture
system	I-Architecture
,	O
while	O
still	O
maintaining	O
semi-automatic	O
release	O
management	O
when	O
using	O
most	O
of	O
the	O
popular	O
code	O
hosting	O
sites	O
.	O
</s>
<s>
The	O
developer	O
is	O
free	O
to	O
host	O
anywhere	O
they	O
choose	O
,	O
and	O
can	O
even	O
choose	O
to	O
avoid	O
public	O
version	B-Architecture
control	I-Architecture
and	O
distribute	O
only	O
plain	O
tarballs	O
.	O
</s>
<s>
A	O
canonical	O
test	O
server	B-Application
exists	O
,	O
where	O
the	O
core	O
system	O
and	O
all	O
eggs	O
are	O
tested	O
daily	O
against	O
the	O
most	O
recent	O
development	O
version	O
(	O
to	O
catch	O
regressive	O
bugs	O
)	O
,	O
and	O
the	O
most	O
recent	O
stable	O
version	O
(	O
to	O
ensure	O
that	O
everything	O
works	O
for	O
users	O
of	O
the	O
stable	O
system	O
)	O
.	O
</s>
<s>
Also	O
,	O
anyone	O
can	O
volunteer	O
to	O
supply	O
further	O
testing	O
capacity	O
,	O
on	O
different	O
:	O
hardware	O
,	O
operating	B-General_Concept
systems	I-General_Concept
,	O
or	O
core	O
releases	O
.	O
</s>
<s>
Chicken	O
supports	O
most	O
of	O
R5RS	B-Language
standard	O
Scheme	B-Language
,	O
but	O
it	O
also	O
adds	O
a	O
few	O
nonstandard	O
features	O
which	O
are	O
not	O
available	O
in	O
all	O
Scheme	B-Language
implementations	O
.	O
</s>
<s>
Chicken	O
compiling	B-Language
to	O
C	B-Language
makes	O
it	O
possible	O
to	O
inject	O
custom	O
C	B-Language
code	O
into	O
the	O
compiled	B-Language
result	O
,	O
which	O
eases	O
integrating	O
with	O
C	B-Language
libraries	O
.	O
</s>
<s>
Its	O
foreign	B-Application
function	I-Application
interface	I-Application
supports	O
converting	O
back	O
and	O
forth	O
between	O
most	O
built-in	O
C	B-Language
types	O
and	O
corresponding	O
Scheme	B-Language
objects	O
.	O
</s>
<s>
Also	O
,	O
extension	O
libraries	O
exist	O
for	O
interfacing	O
to	O
Python	B-Language
,	O
Lua	B-Language
,	O
and	O
Java	B-Language
,	O
via	O
Java	B-Language
Native	I-Language
Interface	I-Language
(	O
JNI	B-Language
)	O
or	O
a	O
bridge	O
.	O
</s>
<s>
It	O
is	O
relatively	O
easy	O
to	O
cross-compile	B-Application
Scheme	B-Language
code	O
to	O
another	O
platform	O
(	O
for	O
example	O
for	O
embedded	O
use	O
on	O
a	O
device	O
)	O
.	O
</s>
<s>
To	O
make	O
cross-compiling	B-Application
possible	O
for	O
Scheme	B-Language
code	O
,	O
Chicken	O
imposes	O
a	O
model	O
of	O
separate	O
compiling	B-Language
:	O
A	O
compiled	B-Language
module	O
consists	O
of	O
two	O
shared	O
libraries	O
.	O
</s>
<s>
One	O
library	B-Library
contains	O
the	O
actual	O
code	O
which	O
will	O
be	O
used	O
at	O
runtime	O
(	O
compiled	B-Language
for	O
the	O
target	O
platform	O
)	O
,	O
and	O
the	O
other	O
is	O
an	O
import	O
module	O
,	O
which	O
will	O
be	O
used	O
to	O
load	O
the	O
code	O
which	O
runs	O
at	O
compile-time	O
(	O
on	O
the	O
host	O
platform	O
)	O
,	O
such	O
as	O
procedural	O
macro	O
code	O
.	O
</s>
<s>
The	O
Chicken	O
compiler	B-Language
can	O
also	O
be	O
easily	O
cross-compiled	O
.	O
</s>
<s>
After	O
translation	O
to	O
C	B-Language
has	O
been	O
achieved	O
,	O
one	O
can	O
simply	O
use	O
a	O
C	B-Language
compiler	B-Language
which	O
is	O
set	O
up	O
to	O
build	O
for	O
another	O
platform	O
.	O
</s>
<s>
Since	O
version	O
4	O
,	O
Chicken	O
has	O
a	O
built-in	O
module	O
system	O
and	O
support	O
for	O
low-level	O
hygienic	B-Application
macros	I-Application
through	O
explicit	O
renaming	O
macros	O
(	O
before	O
version	O
4	O
,	O
this	O
was	O
available	O
through	O
an	O
add-on	O
library	B-Library
)	O
.	O
</s>
<s>
Standard	O
syntax-rules	B-Application
macros	O
are	O
also	O
supported	O
,	O
and	O
implicit	O
renaming	O
macros	O
,	O
which	O
is	O
basically	O
a	O
reversed	O
version	O
of	O
explicit	O
renaming	O
.	O
</s>
<s>
This	O
cost	O
is	O
paid	O
at	O
expansion	O
time	O
,	O
so	O
a	O
macro	O
author	O
must	O
consider	O
if	O
longer	O
compiling	B-Language
times	O
are	O
acceptable	O
.	O
</s>
<s>
When	O
Scheme	B-Language
code	O
is	O
compiled	B-Language
with	O
the	O
needed	O
debugging	O
option	O
,	O
debugging	O
events	O
are	O
injected	O
at	O
specific	O
points	O
in	O
the	O
code	O
.	O
</s>
<s>
These	O
are	O
implemented	O
as	O
calls	O
to	O
a	O
C	B-Language
function	O
,	O
which	O
is	O
relatively	O
low-overhead	O
when	O
not	O
actually	O
debugging	O
the	O
code	O
.	O
</s>
<s>
When	O
debugging	O
,	O
it	O
will	O
try	O
to	O
make	O
a	O
TCP	O
connection	O
to	O
a	O
Feathers	O
server	B-Application
process	O
,	O
possibly	O
on	O
a	O
different	O
machine	O
.	O
</s>
<s>
This	O
allows	O
the	O
compiler	B-Language
to	O
catch	O
variable	O
type	O
errors	O
at	O
compile-time	O
,	O
and	O
perform	O
type	O
specialisation	O
.	O
</s>
<s>
This	O
specialisation	O
makes	O
it	O
possible	O
to	O
remove	O
several	O
safety	O
checks	O
for	O
type	O
detection	O
at	O
runtime	O
when	O
the	O
type	O
can	O
be	O
deduced	O
at	O
compile-time	O
.	O
</s>
<s>
This	O
scrutinizer	O
does	O
not	O
allow	O
cross-module	O
flow	O
analysis	O
,	O
so	O
it	O
can	O
only	O
be	O
used	O
to	O
optimize	O
code	O
that	O
's	O
part	O
of	O
one	O
compiling	B-Language
unit	O
(	O
or	O
module	O
)	O
.	O
</s>
<s>
CHICKEN	B-Language
Scheme	I-Language
was	O
originally	O
developed	O
by	O
Felix	O
Winkelmann	O
on	O
Cygwin/gcc	O
and	O
later	O
Visual	O
C++	O
5.0	O
on	O
Windows	B-Device
98	I-Device
.	O
</s>
