<s>
Pure	O
,	O
successor	O
to	O
the	O
equational	O
language	O
Q	B-Application
,	O
is	O
a	O
dynamically	O
typed	O
,	O
functional	B-Language
programming	I-Language
language	I-Language
based	O
on	O
term	O
rewriting	O
.	O
</s>
<s>
It	O
has	O
facilities	O
for	O
user-defined	O
operator	O
syntax	O
,	O
macros	O
,	O
arbitrary-precision	B-Algorithm
arithmetic	I-Algorithm
(	O
multiple-precision	O
numbers	O
)	O
,	O
and	O
compiling	O
to	O
native	O
code	O
through	O
the	O
LLVM	B-Application
.	O
</s>
<s>
Pure	O
is	O
free	B-License
and	I-License
open-source	I-License
software	I-License
distributed	O
(	O
mostly	O
)	O
under	O
the	O
GNU	B-Application
Lesser	I-Application
General	I-Application
Public	I-Application
License	I-Application
version	O
3	O
or	O
later	O
.	O
</s>
<s>
Pure	O
comes	O
with	O
an	O
interpreter	O
and	O
debugger	O
,	O
provides	O
automatic	O
memory	O
management	O
,	O
has	O
powerful	O
functional	B-Language
and	O
symbolic	O
programming	O
abilities	O
,	O
and	O
interfaces	O
to	O
libraries	B-Library
in	O
C	B-Language
(	O
e.g.	O
,	O
for	O
numerics	O
,	O
low-level	O
protocols	O
,	O
and	O
other	O
such	O
tasks	O
)	O
.	O
</s>
<s>
The	O
syntax	O
of	O
Pure	O
resembles	O
that	O
of	O
Miranda	B-Language
and	O
Haskell	B-Language
,	O
but	O
it	O
is	O
a	O
free-format	B-Language
language	I-Language
and	O
thus	O
uses	O
explicit	O
delimiters	O
(	O
rather	O
than	O
off-side	B-Language
rule	I-Language
indents	O
)	O
to	O
denote	O
program	O
structure	O
.	O
</s>
<s>
The	O
Pure	O
language	O
is	O
a	O
successor	O
of	O
the	O
equational	O
programming	O
language	O
Q	B-Application
,	O
previously	O
created	O
by	O
the	O
same	O
author	O
,	O
Albert	O
Gräf	O
at	O
the	O
University	O
of	O
Mainz	O
,	O
Germany	O
.	O
</s>
<s>
Relative	O
to	O
Q	B-Application
,	O
it	O
offers	O
some	O
important	O
new	O
features	O
(	O
such	O
as	O
local	O
functions	O
with	O
lexical	O
scoping	O
,	O
efficient	O
vector	O
and	O
matrix	O
support	O
,	O
and	O
the	O
built-in	O
C	B-Language
interface	O
)	O
and	O
programs	O
run	O
much	O
faster	O
as	O
they	O
are	O
compiled	O
just-in-time	O
to	O
native	O
code	O
on	O
the	O
fly	O
.	O
</s>
<s>
Pure	O
is	O
mostly	O
aimed	O
at	O
mathematical	O
applications	O
and	O
scientific	O
computing	O
currently	O
,	O
but	O
its	O
interactive	O
interpreter	O
environment	O
,	O
the	O
C	B-Language
interface	O
and	O
the	O
growing	O
set	O
of	O
addon	O
modules	O
make	O
it	O
suitable	O
for	O
a	O
variety	O
of	O
other	O
applications	O
,	O
such	O
as	O
artificial	B-Application
intelligence	I-Application
,	O
symbolic	B-Algorithm
computation	I-Algorithm
,	O
and	O
real-time	O
multimedia	O
processing	O
.	O
</s>
<s>
Pure	O
plug-ins	B-Application
are	O
available	O
for	O
the	O
Gnumeric	B-Language
spreadsheet	O
and	O
Miller	O
Puckette	O
's	O
Pure	B-Language
Data	I-Language
graphical	O
multimedia	O
software	O
,	O
which	O
make	O
it	O
possible	O
to	O
extend	O
these	O
programs	O
with	O
functions	O
written	O
in	O
the	O
Pure	O
language	O
.	O
</s>
<s>
Interfaces	O
are	O
also	O
provided	O
as	O
library	O
modules	O
to	O
GNU	B-Language
Octave	I-Language
,	O
OpenCV	B-Language
,	O
OpenGL	B-Application
,	O
the	O
GNU	B-Application
Scientific	I-Application
Library	I-Application
,	O
FAUST	B-Language
,	O
SuperCollider	B-Application
,	O
and	O
liblo	O
(	O
for	O
Open	O
Sound	O
Control	O
(	O
OSC	O
)	O
)	O
.	O
</s>
<s>
The	O
Fibonacci	B-Algorithm
numbers	I-Algorithm
(	O
naive	O
version	O
)	O
:	O
</s>
<s>
Better	O
(	O
tail-recursive	B-Language
and	O
linear-time	O
)	O
version	O
:	O
</s>
<s>
Compute	O
the	O
first	O
20	O
Fibonacci	B-Algorithm
numbers	I-Algorithm
:	O
</s>
<s>
An	O
algorithm	O
for	O
the	O
n	O
queens	O
problem	O
which	O
employs	O
a	O
list	B-Language
comprehension	I-Language
to	O
organize	O
the	O
backtracking	O
search	O
:	O
</s>
<s>
For	O
instance	O
,	O
David	O
Turner	O
's	O
algorithm	O
for	O
computing	O
the	O
stream	O
of	O
prime	O
numbers	O
by	O
trial	B-Algorithm
division	I-Algorithm
can	O
be	O
expressed	O
in	O
Pure	O
:	O
</s>
<s>
Use	O
of	O
the	O
&	O
operator	O
turns	O
the	O
tail	O
of	O
the	O
sieve	O
into	O
a	O
thunk	B-Application
to	O
delay	O
its	O
computation	O
.	O
</s>
<s>
The	O
thunk	B-Application
is	O
evaluated	O
implicitly	O
and	O
then	O
memoized	O
(	O
using	O
call	O
by	O
need	O
evaluation	O
)	O
when	O
the	O
corresponding	O
part	O
of	O
the	O
list	O
is	O
accessed	O
,	O
e.g.	O
</s>
<s>
Pure	O
has	O
efficient	O
support	O
for	O
vectors	O
and	O
matrices	O
(	O
similar	O
to	O
that	O
of	O
MATLAB	B-Language
and	O
GNU	B-Language
Octave	I-Language
)	O
,	O
including	O
vector	O
and	O
matrix	O
comprehensions	O
.	O
</s>
<s>
E.g.	O
,	O
a	O
Gaussian	B-Algorithm
elimination	I-Algorithm
algorithm	O
with	O
partial	B-Algorithm
pivoting	I-Algorithm
can	O
be	O
implemented	O
in	O
Pure	O
thus	O
:	O
</s>
<s>
As	O
a	O
language	O
based	O
on	O
term	O
rewriting	O
,	O
Pure	O
fully	O
supports	O
symbolic	B-Algorithm
computation	I-Algorithm
with	O
expressions	O
.	O
</s>
<s>
Calling	O
C	B-Language
functions	I-Language
from	O
Pure	O
is	O
very	O
easy	O
.	O
</s>
<s>
E.g.	O
,	O
the	O
following	O
imports	O
the	O
puts	O
function	O
from	O
the	O
C	B-Language
library	I-Language
and	O
uses	O
it	O
to	O
print	O
the	O
string	O
"	O
Hello	O
,	O
world	O
!	O
"	O
</s>
