<s>
Joyce	B-Language
is	O
a	O
secure	O
programming	O
language	O
for	O
concurrent	B-Architecture
computing	I-Architecture
designed	O
by	O
Per	O
Brinch	O
Hansen	O
in	O
the	O
1980s	O
.	O
</s>
<s>
It	O
is	O
based	O
on	O
the	O
sequential	O
language	O
Pascal	B-Application
and	O
the	O
principles	O
of	O
communicating	O
sequential	O
processes	O
(	O
CSP	O
)	O
.	O
</s>
<s>
It	O
was	O
created	O
to	O
address	O
the	O
shortcomings	O
of	O
CSP	O
to	O
be	O
applied	O
as	O
a	O
programming	O
language	O
,	O
and	O
to	O
provide	O
a	O
tool	O
,	O
mainly	O
for	O
teaching	O
,	O
for	O
distributed	B-Architecture
computing	I-Architecture
system	O
implementation	O
.	O
</s>
<s>
The	O
language	O
is	O
based	O
around	O
the	O
concept	O
of	O
agents	O
;	O
concurrently	O
executed	O
processes	O
that	O
communicate	O
only	O
by	O
the	O
use	O
of	O
channels	O
and	O
message	B-Architecture
passing	I-Architecture
.	O
</s>
<s>
The	O
development	O
of	O
Joyce	B-Language
formed	O
the	O
foundation	O
of	O
the	O
language	O
SuperPascal	B-Language
,	O
also	O
developed	O
by	O
Hansen	O
around	O
1993	O
.	O
</s>
<s>
Joyce	B-Language
is	O
based	O
on	O
a	O
small	O
subset	O
of	O
Pascal	B-Application
,	O
extended	O
with	O
features	O
inspired	O
from	O
CSP	O
for	O
concurrency	B-Architecture
.	O
</s>
<s>
This	O
restriction	O
prevents	O
problems	O
associated	O
with	O
the	O
use	O
of	O
shared	O
variables	O
such	O
as	O
race	B-Operating_System
conditions	I-Operating_System
.	O
</s>
<s>
Joyce	B-Language
was	O
designed	O
to	O
be	O
a	O
secure	O
language	O
in	O
the	O
sense	O
that	O
a	O
compiler	O
would	O
be	O
able	O
to	O
detect	O
all	O
violations	O
of	O
the	O
language	O
rules	O
.	O
</s>
<s>
The	O
following	O
is	O
a	O
complete	O
example	O
program	O
,	O
taken	O
from	O
the	O
original	O
paper	O
introducing	O
the	O
Joyce	B-Language
programming	O
language	O
,	O
implementing	O
an	O
algorithm	O
to	O
generate	O
prime	O
numbers	O
based	O
on	O
a	O
sieving	O
technique	O
for	O
generation	O
of	O
primes	O
.	O
</s>
<s>
Due	O
to	O
concurrent	O
execution	O
of	O
agent	O
procedures	O
,	O
a	O
conventional	O
sequential	O
stack	B-Application
allocation	O
scheme	O
cannot	O
be	O
used	O
as	O
the	O
activation	O
records	O
of	O
the	O
agent	O
calls	O
do	O
not	O
follow	O
a	O
last-in	O
first-out	O
pattern	O
.	O
</s>
<s>
Instead	O
,	O
the	O
creator-subagent	O
relationships	O
form	O
a	O
tree-structured	O
stack	B-Application
.	O
</s>
<s>
A	O
simple	O
scheme	O
is	O
used	O
to	O
implement	O
this	O
behaviour	O
,	O
which	O
works	O
by	O
allocating	O
new	O
activation	O
records	O
at	O
the	O
top	O
of	O
the	O
stack	B-Application
,	O
and	O
linking	O
subagents	O
 '	O
activation	O
records	O
to	O
their	O
creator	O
's	O
record	O
.	O
</s>
<s>
These	O
records	O
are	O
freed	O
only	O
when	O
the	O
agent	O
has	O
terminated	O
and	O
they	O
are	O
at	O
the	O
top	O
of	O
the	O
stack	B-Application
.	O
</s>
<s>
A	O
more	O
effective	O
scheme	O
was	O
implemented	O
in	O
Hansen	O
's	O
language	O
SuperPascal	B-Language
.	O
</s>
