<s>
Factor	O
is	O
a	O
stack-oriented	B-Language
programming	I-Language
language	I-Language
created	O
by	O
Slava	B-Application
Pestov	I-Application
.	O
</s>
<s>
Factor	O
is	O
dynamically	O
typed	O
and	O
has	O
automatic	B-General_Concept
memory	I-General_Concept
management	I-General_Concept
,	O
as	O
well	O
as	O
powerful	O
metaprogramming	O
features	O
.	O
</s>
<s>
The	O
language	O
has	O
a	O
single	O
implementation	O
featuring	O
a	O
self-hosted	O
optimizing	B-Application
compiler	I-Application
and	O
an	O
interactive	B-Application
development	I-Application
environment	I-Application
.	O
</s>
<s>
The	O
Factor	O
distribution	O
includes	O
a	O
large	O
standard	B-Library
library	I-Library
.	O
</s>
<s>
Slava	B-Application
Pestov	I-Application
created	O
Factor	O
in	O
2003	O
as	O
a	O
scripting	B-Language
language	I-Language
for	O
a	O
video	O
game	O
.	O
</s>
<s>
The	O
initial	O
implementation	O
,	O
now	O
referred	O
to	O
as	O
JFactor	O
,	O
was	O
implemented	O
in	O
Java	B-Language
and	O
ran	O
on	O
the	O
Java	B-Language
Virtual	I-Language
Machine	I-Language
.	O
</s>
<s>
Originally	O
,	O
Factor	O
programs	O
centered	O
on	O
manipulating	O
Java	B-Language
objects	O
with	O
Java	B-Language
's	O
reflection	B-Language
capabilities	O
.	O
</s>
<s>
As	O
the	O
Factor	O
implementation	O
and	O
standard	B-Library
libraries	I-Library
grew	O
more	O
detailed	O
,	O
the	O
need	O
for	O
certain	O
language	O
features	O
became	O
clear	O
,	O
and	O
they	O
were	O
added	O
.	O
</s>
<s>
JFactor	O
did	O
not	O
have	O
an	O
object	B-Language
system	I-Language
where	O
the	O
programmer	O
could	O
define	O
their	O
own	O
classes	O
,	O
and	O
early	O
versions	O
of	O
native	O
Factor	O
were	O
the	O
same	O
;	O
the	O
language	O
was	O
similar	O
to	O
Scheme	B-Language
in	O
this	O
way	O
.	O
</s>
<s>
Today	O
,	O
the	O
object	B-Language
system	I-Language
is	O
a	O
central	O
part	O
of	O
Factor	O
.	O
</s>
<s>
Other	O
important	O
language	O
features	O
such	O
as	O
tuple	B-Application
classes	O
,	O
combinator	O
inlining	O
,	O
macros	O
,	O
user-defined	O
parsing	B-Language
words	O
and	O
the	O
modern	O
vocabulary	O
system	O
were	O
only	O
added	O
in	O
a	O
piecemeal	O
fashion	O
as	O
their	O
utility	O
became	O
clear	O
.	O
</s>
<s>
The	O
foreign	B-Application
function	I-Application
interface	I-Application
was	O
present	O
from	O
very	O
early	O
versions	O
to	O
Factor	O
,	O
and	O
an	O
analogous	O
system	O
existed	O
in	O
JFactor	O
.	O
</s>
<s>
This	O
was	O
chosen	O
over	O
creating	O
a	O
plugin	O
to	O
the	O
C	B-Language
part	O
of	O
the	O
implementation	O
for	O
each	O
external	O
library	B-Library
that	O
Factor	O
should	O
communicate	O
with	O
,	O
and	O
has	O
the	O
benefit	O
of	O
being	O
more	O
declarative	B-Language
,	O
faster	O
to	O
compile	O
and	O
easier	O
to	O
write	O
.	O
</s>
<s>
The	O
Java	B-Language
implementation	O
initially	O
consisted	O
of	O
just	O
an	O
interpreter	B-Application
,	O
but	O
a	O
compiler	O
to	O
Java	B-Language
bytecode	I-Language
was	O
later	O
added	O
.	O
</s>
<s>
The	O
Java	B-Language
version	O
of	O
Factor	O
was	O
replaced	O
by	O
a	O
version	O
written	O
in	O
C	B-Language
and	O
Factor	O
.	O
</s>
<s>
Initially	O
,	O
this	O
consisted	O
of	O
just	O
an	O
interpreter	B-Application
,	O
but	O
the	O
interpreter	B-Application
was	O
replaced	O
by	O
two	O
compilers	O
,	O
used	O
in	O
different	O
situations	O
.	O
</s>
<s>
Factor	O
is	O
a	O
dynamically	O
typed	O
,	O
functional	B-Language
and	O
object-oriented	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
Arguments	O
to	O
words	O
are	O
passed	O
on	O
a	O
data	B-Application
stack	I-Application
,	O
using	O
reverse	B-Application
Polish	I-Application
notation	O
.	O
</s>
<s>
The	O
stack	B-Application
is	O
used	O
just	O
to	O
organize	O
calls	O
to	O
words	O
,	O
and	O
not	O
as	O
a	O
data	O
structure	O
.	O
</s>
<s>
The	O
stack	B-Application
in	O
Factor	O
is	O
used	O
in	O
a	O
similar	O
way	O
to	O
the	O
stack	B-Application
in	O
Forth	B-Application
;	O
for	O
this	O
,	O
they	O
are	O
both	O
considered	O
stack	B-Language
languages	I-Language
.	O
</s>
<s>
print	O
is	O
a	O
word	O
in	O
the	O
io	O
vocabulary	O
that	O
takes	O
a	O
string	O
from	O
the	O
stack	B-Application
and	O
returns	O
nothing	O
.	O
</s>
<s>
Not	O
all	O
data	O
has	O
to	O
be	O
passed	O
around	O
only	O
with	O
the	O
stack	B-Application
.	O
</s>
<s>
Dynamically	O
scoped	O
variables	O
are	O
used	O
to	O
pass	O
things	O
between	O
procedure	O
calls	O
without	O
using	O
the	O
stack	B-Application
.	O
</s>
<s>
It	O
is	O
also	O
used	O
in	O
the	O
XML	B-Protocol
library	B-Library
to	O
provide	O
literal	O
syntax	O
for	O
generating	O
XML	B-Protocol
.	O
</s>
<s>
For	O
example	O
,	O
the	O
following	O
word	O
takes	O
a	O
string	O
and	O
produces	O
an	O
XML	B-Protocol
document	I-Protocol
object	O
which	O
is	O
an	O
HTML	O
document	O
emphasizing	O
the	O
string	O
:	O
</s>
<s>
The	O
word	O
dup	O
duplicates	O
the	O
top	O
item	O
on	O
the	O
stack	B-Application
.	O
</s>
<s>
The	O
<->	O
stands	O
for	O
filling	O
in	O
that	O
part	O
of	O
the	O
XML	B-Protocol
document	I-Protocol
with	O
an	O
item	O
from	O
the	O
stack	B-Application
.	O
</s>
<s>
Factor	O
includes	O
a	O
large	O
standard	B-Library
library	I-Library
,	O
written	O
entirely	O
in	O
the	O
language	O
.	O
</s>
<s>
A	O
cross-platform	O
GUI	O
toolkit	O
,	O
built	O
on	O
top	O
of	O
OpenGL	B-Application
and	O
various	O
windowing	O
systems	O
,	O
used	O
for	O
the	O
development	O
environment	O
.	O
</s>
<s>
Bindings	O
to	O
several	O
database	O
libraries	O
,	O
including	O
PostgreSQL	B-Application
and	O
SQLite	B-Language
.	O
</s>
<s>
An	O
HTTP	B-Protocol
server	O
and	O
client	O
,	O
with	O
the	O
Furnace	O
web	O
framework	O
.	O
</s>
<s>
Efficient	O
homogeneous	O
arrays	O
of	O
integers	O
,	O
floats	O
and	O
C	B-Language
structs	O
.	O
</s>
<s>
A	O
library	B-Library
implementing	O
regular	O
expressions	O
,	O
generating	O
machine	O
code	O
to	O
do	O
the	O
matching	O
.	O
</s>
<s>
A	O
foreign	B-Application
function	I-Application
interface	I-Application
is	O
built	O
into	O
Factor	O
,	O
allowing	O
for	O
communication	O
with	O
C	B-Language
,	O
Objective-C	B-Language
and	O
Fortran	B-Application
programs	O
.	O
</s>
<s>
There	O
is	O
also	O
support	O
for	O
executing	O
and	O
communicating	O
with	O
shaders	O
written	O
in	O
GLSL	B-Language
.	O
</s>
<s>
Factor	O
is	O
implemented	O
in	O
Factor	O
and	O
C++	B-Language
.	O
</s>
<s>
It	O
was	O
originally	O
bootstrapped	O
from	O
an	O
earlier	O
Java	B-Language
implementation	O
.	O
</s>
<s>
Today	O
,	O
the	O
parser	O
and	O
the	O
optimizing	B-Application
compiler	I-Application
are	O
written	O
in	O
the	O
language	O
.	O
</s>
<s>
Certain	O
basic	O
parts	O
of	O
the	O
language	O
are	O
implemented	O
in	O
C++	B-Language
such	O
as	O
the	O
garbage	B-General_Concept
collector	I-General_Concept
and	O
certain	O
primitives	O
.	O
</s>
<s>
Factor	O
uses	O
an	O
image-based	O
model	O
,	O
analogous	O
to	O
many	O
Smalltalk	B-Application
implementations	O
,	O
where	O
compiled	O
code	O
and	O
data	O
are	O
stored	O
in	O
an	O
image	B-Operating_System
.	O
</s>
<s>
To	O
compile	O
a	O
program	O
,	O
the	O
program	O
is	O
loaded	O
into	O
an	O
image	B-Operating_System
and	O
the	O
image	B-Operating_System
is	O
saved	O
.	O
</s>
<s>
A	O
special	O
tool	O
assists	O
in	O
the	O
process	O
of	O
creating	O
a	O
minimal	O
image	B-Operating_System
to	O
run	O
a	O
particular	O
program	O
,	O
packaging	O
the	O
result	O
into	O
something	O
that	O
can	O
be	O
deployed	O
as	O
a	O
standalone	O
application	O
.	O
</s>
