<s>
Compiler	B-Application
Description	I-Application
Language	I-Application
(	O
CDL	O
)	O
is	O
a	O
programming	O
language	O
based	O
on	O
affix	O
grammars	O
.	O
</s>
<s>
It	O
was	O
designed	O
for	O
the	O
development	O
of	O
compilers	B-Language
.	O
</s>
<s>
On	O
the	O
one	O
hand	O
,	O
they	O
make	O
possible	O
the	O
sophisticated	O
data	O
and	O
control	O
flow	O
analysis	O
used	O
by	O
the	O
CDL2	B-Application
optimizers	O
resulting	O
in	O
extremely	O
efficient	O
code	O
.	O
</s>
<s>
The	O
language	O
looks	O
a	O
bit	O
like	O
Prolog	B-Language
(	O
this	O
is	O
not	O
surprising	O
since	O
both	O
languages	O
arose	O
at	O
about	O
the	O
same	O
time	O
out	O
of	O
work	O
on	O
affix	O
grammars	O
)	O
.	O
</s>
<s>
However	O
,	O
as	O
opposed	O
to	O
Prolog	B-Language
,	O
control	O
flow	O
in	O
CDL	O
is	O
deterministically	O
based	O
on	O
success/failure	O
,	O
i.e.	O
,	O
no	O
other	O
alternatives	O
are	O
tried	O
when	O
the	O
current	O
one	O
succeeds	O
.	O
</s>
<s>
Those	O
represent	O
the	O
core	O
,	O
the	O
most	O
basic	O
abstractions	B-Application
that	O
the	O
given	O
language	O
supports	O
.	O
</s>
<s>
It	O
is	O
the	O
responsibility	O
of	O
the	O
programmer	O
to	O
provide	O
the	O
primitive	O
operations	O
in	O
a	O
form	O
that	O
can	O
then	O
be	O
turned	O
into	O
machine	O
instructions	O
by	O
means	O
of	O
an	O
assembler	O
or	O
a	O
compiler	B-Language
for	O
a	O
traditional	O
language	O
.	O
</s>
<s>
The	O
language	O
provides	O
operators	O
to	O
create	O
evaluation	O
loops	O
without	O
recursion	O
(	O
although	O
this	O
is	O
not	O
strictly	O
necessary	O
in	O
CDL2	B-Application
as	O
the	O
optimizer	O
achieves	O
the	O
same	O
effect	O
)	O
and	O
some	O
shortcuts	O
to	O
increase	O
the	O
efficiency	O
of	O
the	O
otherwise	O
recursive	O
evaluation	O
,	O
but	O
the	O
basic	O
concept	O
is	O
as	O
above	O
.	O
</s>
<s>
The	O
CDL2	B-Application
compiler	B-Language
is	O
able	O
to	O
flag	O
the	O
possible	O
violations	O
thanks	O
to	O
the	O
requirement	O
that	O
the	O
direction	O
of	O
parameters	O
(	O
input	O
,	O
output	O
,	O
input-output	O
)	O
and	O
the	O
type	O
of	O
rules	O
(	O
can	O
fail	O
:	O
test	O
,	O
predicate	O
;	O
cannot	O
fail	O
:	O
function	O
,	O
action	O
;	O
can	O
have	O
a	O
side	O
effect	O
:	O
predicate	O
,	O
action	O
;	O
cannot	O
have	O
a	O
side	O
effect	O
:	O
test	O
,	O
function	O
)	O
must	O
be	O
specified	O
by	O
the	O
programmer	O
.	O
</s>
<s>
The	O
CDL	O
compiler	B-Language
uses	O
your	O
code	O
as	O
strings	O
(	O
there	O
are	O
conventions	O
on	O
how	O
to	O
refer	O
to	O
the	O
input	O
and	O
output	O
variables	O
)	O
and	O
simply	O
emits	O
it	O
as	O
needed	O
.	O
</s>
<s>
If	O
you	O
describe	O
your	O
adding	O
rule	O
using	O
assembly	O
,	O
you	O
will	O
need	O
an	O
assembler	O
to	O
translate	O
the	O
CDL	O
compiler	B-Language
's	O
output	O
into	O
the	O
machine	O
code	O
.	O
</s>
<s>
If	O
you	O
describe	O
all	O
the	O
primitive	O
rules	O
(	O
macros	O
in	O
CDL	O
terminology	O
)	O
in	O
Pascal	O
or	O
C	O
,	O
then	O
you	O
need	O
a	O
Pascal	O
or	O
C	O
compiler	B-Language
to	O
run	O
after	O
the	O
CDL	O
compiler	B-Language
.	O
</s>
<s>
To	O
get	O
a	O
feel	O
for	O
the	O
language	O
,	O
here	O
is	O
a	O
small	O
code	O
fragment	O
adapted	O
from	O
the	O
CDL2	B-Application
manual	O
:	O
</s>
<s>
CDL2	B-Application
,	O
which	O
appeared	O
in	O
1976	O
,	O
kept	O
the	O
principles	O
of	O
CDL1	O
but	O
made	O
the	O
language	O
suitable	O
for	O
large	O
projects	O
.	O
</s>
<s>
The	O
optimizers	O
in	O
the	O
CDL2	B-Application
compiler	B-Language
and	O
especially	O
in	O
the	O
CDL2	B-Application
Laboratory	O
(	O
an	O
IDE	O
for	O
CDL2	B-Application
)	O
were	O
world-class	O
and	O
not	O
just	O
for	O
their	O
time	O
.	O
</s>
<s>
One	O
feature	O
of	O
the	O
CDL2	B-Application
Laboratory	O
optimizer	O
is	O
almost	O
unique	O
:	O
it	O
can	O
perform	O
optimizations	O
across	O
compilation	B-Language
units	O
,	O
i.e.	O
,	O
treating	O
the	O
entire	O
program	O
as	O
a	O
single	O
compilation	B-Language
.	O
</s>
<s>
The	O
commercial	O
mbp	O
Cobol	O
(	O
a	O
Cobol	O
compiler	B-Language
for	O
the	O
PC	O
)	O
as	O
well	O
as	O
the	O
MProlog	O
system	O
(	O
an	O
industrial-strength	O
Prolog	B-Language
implementation	O
that	O
ran	O
on	O
numerous	O
architectures	O
(	O
IBM	O
mainframe	O
,	O
VAX	O
,	O
PDP-11	O
,	O
Intel	O
8086	O
,	O
etc	O
.	O
)	O
</s>
<s>
The	O
latter	O
,	O
in	O
particular	O
,	O
is	O
testimony	O
to	O
CDL2	B-Application
's	O
portability	O
.	O
</s>
<s>
While	O
most	O
programs	O
written	O
with	O
CDL	O
have	O
been	O
compilers	B-Language
,	O
there	O
is	O
at	O
least	O
one	O
commercial	O
GUI	O
application	O
that	O
was	O
developed	O
and	O
maintained	O
in	O
CDL	O
.	O
</s>
<s>
The	O
software	O
for	O
the	O
Mephisto	B-General_Concept
III	I-General_Concept
chess	I-General_Concept
computer	I-General_Concept
was	O
written	O
with	O
CDL2	B-Application
.	O
</s>
