<s>
ALGOL	B-General_Concept
68RS	I-General_Concept
is	O
the	O
second	O
ALGOL	B-Language
68	I-Language
compiler	B-Language
written	O
by	O
I	O
.	O
F	O
.	O
Currie	O
and	O
J	O
.	O
D	O
.	O
Morrison	O
,	O
at	O
the	O
Royal	O
Signals	O
and	O
Radar	O
Establishment	O
(	O
RSRE	O
)	O
.	O
</s>
<s>
Unlike	O
the	O
earlier	O
ALGOL	B-General_Concept
68-R	I-General_Concept
,	O
it	O
was	O
designed	O
to	O
be	O
portable	B-Architecture
,	O
and	O
implemented	O
the	O
language	O
of	O
the	O
Revised	O
Report	O
.	O
</s>
<s>
Versions	O
of	O
ALGOL	B-General_Concept
68RS	I-General_Concept
were	O
written	O
for	O
the	O
ICL	B-Device
2900	I-Device
Series	I-Device
,	O
Multics	B-Application
,	O
and	O
VAX	B-Device
running	O
VMS	B-Operating_System
.	O
</s>
<s>
Subsequently	O
,	O
parts	O
of	O
this	O
compiler	B-Language
were	O
released	O
into	O
the	O
public	O
domain	O
,	O
as	O
a	O
translator	B-Application
from	O
ALGOL	B-Language
68	I-Language
to	O
C	B-Language
,	O
as	O
part	O
of	O
the	O
public	O
release	O
of	O
the	O
hardware	O
description	O
language	O
ELLA	B-Language
,	O
also	O
by	O
the	O
RSRE	O
.	O
</s>
<s>
Although	O
the	O
ALGOL	B-General_Concept
68-R	I-General_Concept
compiler	B-Language
,	O
written	O
by	O
I.F.	O
</s>
<s>
Bond	O
,	O
was	O
a	O
great	O
success	O
,	O
it	O
suffered	O
from	O
two	O
major	O
problems	O
:	O
it	O
had	O
been	O
written	O
for	O
the	O
nearly	O
obsolete	O
ICL	B-Device
1900	I-Device
computer	O
,	O
and	O
it	O
implemented	O
an	O
out-of-date	O
version	O
of	O
the	O
language	O
as	O
it	O
was	O
released	O
before	O
the	O
Revised	O
Report	O
on	O
ALGOL	B-Language
68	I-Language
was	O
available	O
.	O
</s>
<s>
RSRE	O
needed	O
a	O
newer	O
compiler	B-Language
for	O
various	O
internal	O
projects	O
,	O
so	O
the	O
team	O
of	O
Currie	O
and	O
Morrison	O
wrote	O
a	O
new	O
compiler	B-Language
designed	O
for	O
cross-platform	B-Operating_System
software	I-Operating_System
portability	B-Architecture
between	O
machines	O
.	O
</s>
<s>
The	O
compiler	B-Language
dealt	O
with	O
the	O
parsing	O
of	O
ALGOL	B-Language
68	I-Language
,	O
producing	O
a	O
high	O
level	O
intermediate	O
language	O
known	O
as	O
stream	O
language	O
that	O
is	O
then	O
compiled	B-Language
to	O
machine	B-Language
code	I-Language
by	O
a	O
translator	B-Application
.	O
</s>
<s>
The	O
compiler	B-Language
needed	O
to	O
know	O
only	O
the	O
sizes	O
of	O
the	O
various	O
object	O
machine	O
data	O
types	O
and	O
the	O
character	B-General_Concept
encoding	I-General_Concept
(	O
set	O
)	O
available	O
.	O
</s>
<s>
The	O
compiler	B-Language
was	O
written	O
in	O
ALGOL	B-Language
68	I-Language
,	O
bootstrapped	B-Application
initially	O
using	O
the	O
ALGOL	B-General_Concept
68-R	I-General_Concept
compiler	B-Language
.	O
</s>
<s>
A	O
team	O
of	O
two	O
programmers	O
at	O
Oxford	O
University	O
Computing	O
Services	O
wrote	O
a	O
code	O
generator	O
for	O
the	O
ICL	B-Device
2900	I-Device
series	I-Device
.	O
</s>
<s>
Later	O
,	O
the	O
Avon	O
Universities	O
Joint	O
Computer	O
Centre	O
,	O
a	O
large	O
user	O
of	O
Multics	B-Application
requested	O
the	O
SWURCC	O
team	O
to	O
produce	O
a	O
Multics	B-Application
version	O
of	O
ALGOL	B-General_Concept
68RS	I-General_Concept
.	O
</s>
<s>
A	O
version	O
for	O
the	O
Digital	O
Equipment	O
Corporation	O
(	O
DEC	O
)	O
VAX	B-Device
computer	O
was	O
also	O
written	O
.	O
</s>
<s>
Eventually	O
the	O
team	O
at	O
SWURCC	O
formed	O
a	O
company	O
,	O
Praxis	O
,	O
initially	O
supporting	O
the	O
Multics	B-Application
version	O
of	O
ALGOL	B-General_Concept
68RS	I-General_Concept
.	O
</s>
<s>
RSRE	O
also	O
used	O
the	O
ALGOL	B-General_Concept
68RS	I-General_Concept
compiler	B-Language
for	O
internal	O
projects	O
,	O
including	O
the	O
Flex	B-Device
machine	I-Device
and	O
the	O
ELLA	B-Language
hardware	O
design	O
language	O
.	O
</s>
<s>
When	O
it	O
was	O
decided	O
to	O
make	O
ELLA	B-Language
freely	O
available	O
,	O
Praxis	O
was	O
commissioned	O
to	O
write	O
an	O
ALGOL	B-Language
68	I-Language
to	O
C	B-Language
translator	B-Application
named	O
ctrans	O
,	O
based	O
on	O
the	O
ALGOL	B-General_Concept
68RS	I-General_Concept
compiler	B-Language
.	O
</s>
<s>
Like	O
the	O
earlier	O
ALGOL	B-General_Concept
68-R	I-General_Concept
compiler	B-Language
,	O
ALGOL	B-General_Concept
68RS	I-General_Concept
was	O
a	O
one-pass	B-Language
compiler	I-Language
,	O
which	O
required	O
some	O
restrictions	O
on	O
the	O
language	O
compiled	B-Language
.	O
</s>
<s>
The	O
ALGOL	B-Language
68	I-Language
program	O
:	O
</s>
<s>
To	O
allow	O
recursive	O
declarations	O
of	O
modes	O
(	O
types	O
)	O
a	O
special	O
stub	O
mode	O
declaration	O
was	O
used	O
to	O
inform	O
the	O
compiler	B-Language
that	O
an	O
upcoming	O
symbol	O
was	O
a	O
mode	O
rather	O
than	O
an	O
operator	O
:	O
</s>
<s>
A	O
=	O
STRUCT	B-Language
(	O
REF	O
B	O
b	O
)	O
,	O
</s>
<s>
Like	O
ALGOL	B-General_Concept
68-R	I-General_Concept
,	O
the	O
operators	O
PAR	O
clause	O
and	O
the	O
SEMA	O
mode	O
with	O
its	O
associated	O
UP	O
,	O
DOWN	O
,	O
and	O
LEVEL	O
,	O
were	O
omitted	O
.	O
</s>
<s>
One	O
major	O
misfeature	O
of	O
ALGOL	B-Language
68	I-Language
is	O
that	O
it	O
is	O
impossible	O
to	O
write	O
the	O
standard	O
transput	B-General_Concept
(	O
input/output	B-General_Concept
)	O
procedures	O
in	O
pure	O
ALGOL	B-Language
68	I-Language
.	O
</s>
<s>
The	O
print	O
procedure	O
takes	O
,	O
for	O
example	O
,	O
an	O
array	B-Data_Structure
of	O
items	O
to	O
print	O
of	O
any	O
mode	O
and	O
,	O
by	O
a	O
process	O
named	O
straightening	O
,	O
converts	O
them	O
into	O
simple	O
values	O
that	O
can	O
be	O
printed	O
.	O
</s>
<s>
STRUCT	B-Language
(	O
INT	O
a	O
,	O
REAL	O
b	O
)	O
c	B-Language
:=	O
...	O
;	O
</s>
<s>
The	O
writers	O
of	O
ALGOL	B-General_Concept
68RS	I-General_Concept
decided	O
to	O
make	O
straightening	O
available	O
as	O
part	O
of	O
the	O
language	O
.	O
</s>
<s>
A	O
STRAIGHT	O
mode	O
resembles	O
an	O
array	B-Data_Structure
but	O
has	O
the	O
special	O
feature	O
that	O
items	O
can	O
be	O
coerced	O
to	O
a	O
STRAIGHT	O
mode	O
if	O
their	O
components	O
can	O
be	O
coerced	O
to	O
the	O
mode	O
.	O
</s>
<s>
STRUCT	B-Language
(	O
INT	O
a	O
,	O
REAL	O
b	O
)	O
c	B-Language
;	O
</s>
<s>
STRAIGHT	O
UNION	O
(	O
INT	O
,	O
REAL	O
)	O
z	O
=	O
c	B-Language
;	O
</s>
<s>
Both	O
the	O
fields	O
of	O
C	B-Language
can	O
be	O
coerced	O
to	O
UNION	O
(	O
INT	O
,	O
REAL	O
)	O
so	O
the	O
field	O
"	O
a	O
OF	O
c	B-Language
"	O
can	O
be	O
accessed	O
as	O
z[1]	O
and	O
"	O
b	O
OF	O
c	B-Language
"	O
is	O
z[2]	O
.	O
</s>
<s>
The	O
ALGOL	B-Language
68	I-Language
array	B-Data_Structure
modes	O
are	O
very	O
powerful	O
,	O
including	O
multiple	O
dimensions	O
,	O
defined	O
upper	O
and	O
lower	O
bounds	O
,	O
trimming	O
(	O
making	O
a	O
new	O
array	B-Data_Structure
by	O
taking	O
a	O
contiguous	O
subset	O
of	O
an	O
array	B-Data_Structure
)	O
,	O
slicing	O
(	O
making	O
a	O
new	O
array	B-Data_Structure
by	O
removing	O
one	O
dimension	O
from	O
an	O
array	B-Data_Structure
)	O
,	O
and	O
rowing	O
(	O
making	O
a	O
new	O
array	B-Data_Structure
by	O
adding	O
a	O
dimension	O
to	O
an	O
extant	O
array	B-Data_Structure
.	O
</s>
<s>
While	O
the	O
compiler	B-Language
made	O
all	O
efforts	O
to	O
generate	O
optimal	O
code	O
for	O
all	O
cases	O
,	O
it	O
was	O
felt	O
that	O
adding	O
some	O
simpler	O
facilities	O
would	O
allow	O
better	O
code	O
in	O
some	O
cases	O
.	O
</s>
<s>
To	O
this	O
end	O
ALGOL	B-General_Concept
68RS	I-General_Concept
included	O
indexable	O
structures	O
(	O
i-structs	O
)	O
,	O
vectors	O
,	O
and	O
the	O
FORALL	O
statement	O
.	O
</s>
<s>
ALGOL	B-Language
68	I-Language
already	O
included	O
fixed	O
length	O
structures	O
to	O
efficiently	O
handle	O
characters	O
and	O
bit-data	O
on	O
word-based	O
machines	O
,	O
the	O
BYTES	O
and	O
BITS	O
modes	O
.	O
</s>
<s>
ALGOL	B-General_Concept
68RS	I-General_Concept
generalised	O
these	O
ideas	O
.	O
</s>
<s>
A	O
STRUCT	B-Language
4	O
CHAR	O
variable	O
held	O
exactly	O
4	O
chars	O
.	O
</s>
<s>
On	O
most	O
ALGOL	B-General_Concept
68RS	I-General_Concept
systems	O
,	O
the	O
mode	O
BYTES	O
was	O
equivalent	O
to	O
STRUCT	B-Language
4	O
CHAR	O
.	O
</s>
<s>
MODE	O
BYTES	O
=	O
STRUCT	B-Language
4	O
CHAR	O
;	O
</s>
<s>
The	O
ALGOL	B-General_Concept
68RS	I-General_Concept
compiler	B-Language
would	O
compile	B-Language
any	O
string	O
constant	O
to	O
an	O
appropriate	O
STRUCT	B-Language
n	O
CHAR	O
.	O
</s>
<s>
In	O
contexts	O
where	O
a	O
VECTOR	O
or	O
array	B-Data_Structure
was	O
wanted	O
,	O
an	O
i-struct	O
could	O
be	O
widened	O
to	O
the	O
appropriate	O
VECTOR	O
or	O
array	B-Data_Structure
type	O
.	O
</s>
<s>
A	O
VECTOR	O
is	O
a	O
simplified	O
array	B-Data_Structure
,	O
with	O
only	O
one	O
dimension	O
and	O
a	O
lower	O
bound	O
fixed	O
at	O
1	O
.	O
</s>
<s>
In	O
any	O
context	O
where	O
an	O
array	B-Data_Structure
was	O
required	O
a	O
VECTOR	O
could	O
be	O
converted	O
to	O
an	O
array	B-Data_Structure
.	O
</s>
<s>
The	O
FORALL	O
statement	O
allows	O
efficient	O
stepping	O
through	O
the	O
elements	O
of	O
an	O
array	B-Data_Structure
.	O
</s>
<s>
ALGOL	B-General_Concept
68RS	I-General_Concept
provided	O
a	O
mechanism	O
to	O
build	O
libraries	B-Library
similar	O
to	O
the	O
separate	O
compiling	B-Language
facilities	O
of	O
ALGOL	B-General_Concept
68-R	I-General_Concept
and	O
a	O
mechanism	O
to	O
build	O
programs	O
in	O
a	O
top-down	O
manner	O
similar	O
to	O
those	O
of	O
ALGOL	O
68C	O
.	O
</s>
<s>
Libraries	B-Library
in	O
ALGOL	B-General_Concept
68RS	I-General_Concept
are	O
written	O
using	O
declaration	O
modules	O
which	O
consist	O
of	O
a	O
sequence	O
of	O
MODE	O
,	O
variable	O
,	O
operator	O
and	O
procedure	O
declarations	O
followed	O
by	O
a	O
keep	O
list	O
which	O
defines	O
which	O
declarations	O
are	O
visible	O
to	O
other	O
segments	O
.	O
</s>
<s>
The	O
library	O
user	O
then	O
adds	O
a	O
USE	O
header	O
that	O
tells	O
the	O
compiler	B-Language
to	O
make	O
the	O
symbols	O
of	O
one	O
or	O
more	O
declaration	O
libraries	B-Library
available	O
to	O
the	O
program	O
.	O
</s>
<s>
MODE	O
GRAPHDATA	O
=	O
STRUCT	B-Language
(	O
...	O
)	O
;	O
</s>
<s>
To	O
support	O
a	O
top-down	O
programming	O
style	O
,	O
ALGOL	B-General_Concept
68RS	I-General_Concept
provided	O
the	O
HERE	O
and	O
CONTEXT	O
facilities	O
.	O
</s>
<s>
ALGOL	B-General_Concept
68RS	I-General_Concept
was	O
intended	O
to	O
be	O
usable	O
for	O
low	O
level	O
systems	B-Application
programming	I-Application
.	O
</s>
<s>
To	O
allow	O
this	O
,	O
facilities	O
were	O
included	O
for	O
access	O
to	O
machine	B-Language
code	I-Language
and	O
non-ALGOL	O
68RS	O
objects	O
.	O
</s>
<s>
Where	O
the	O
items	O
are	O
ALGOL	B-General_Concept
68RS	I-General_Concept
values	O
to	O
be	O
made	O
available	O
to	O
the	O
code	O
insertion	O
and	O
SOMEMODE	O
is	O
the	O
mode	O
returned	O
.	O
</s>
<s>
Access	O
to	O
non-ALGOL68	O
objects	O
was	O
available	O
with	O
the	O
ALIEN	O
insertion	O
:	O
</s>
<s>
Any	O
simple	O
ALGOL	B-General_Concept
68RS	I-General_Concept
object	O
could	O
be	O
cast	O
into	O
a	O
VECTOR	O
of	O
characters	O
using	O
the	O
SPELL	O
operator	O
:	O
</s>
<s>
STRUCT	B-Language
(	O
INT	O
a	O
,	O
REAL	O
b	O
)	O
c	B-Language
=	O
...	O
;	O
</s>
<s>
print	O
( ( 	O
"	O
internal	O
repr	O
=	O
"	O
,	O
SPELL	O
c	B-Language
,	O
newline	O
)	O
)	O
;	O
</s>
<s>
The	O
ALGOL	B-Language
68	I-Language
to	O
C	B-Language
translator	B-Application
written	O
by	O
Praxis	O
for	O
the	O
ELLA	B-Language
system	O
contains	O
most	O
of	O
the	O
ALGOL	B-General_Concept
68RS	I-General_Concept
compiler	B-Language
.	O
</s>
<s>
,	O
ALGOL	B-General_Concept
68RS	I-General_Concept
is	O
available	O
from	O
SourceForge	B-Application
.	O
</s>
