<s>
Prototype-based	B-Application
programming	I-Application
is	O
a	O
style	O
of	O
object-oriented	B-Language
programming	I-Language
in	O
which	O
behaviour	O
reuse	O
(	O
known	O
as	O
inheritance	B-Language
)	O
is	O
performed	O
via	O
a	O
process	O
of	O
reusing	O
existing	O
objects	O
that	O
serve	O
as	O
prototypes	B-Application
.	O
</s>
<s>
This	O
model	O
can	O
also	O
be	O
known	O
as	O
prototypal	O
,	O
prototype-oriented	B-Application
,	O
classless	O
,	O
or	O
instance-based	B-Application
programming	I-Application
.	O
</s>
<s>
Prototype-based	B-Application
programming	I-Application
uses	O
the	O
process	O
generalized	O
objects	O
,	O
which	O
can	O
then	O
be	O
cloned	O
and	O
extended	O
.	O
</s>
<s>
Compare	O
to	O
the	O
class-based	B-Application
paradigm	O
,	O
where	O
a	O
"	O
fruit	O
"	O
class	O
would	O
be	O
extended	O
by	O
a	O
"	O
banana	O
"	O
class	O
.	O
</s>
<s>
The	O
first	O
prototype-oriented	B-Application
programming	I-Application
language	O
was	O
Self	B-Operating_System
,	O
developed	O
by	O
David	O
Ungar	O
and	O
Randall	O
Smith	O
in	O
the	O
mid-1980s	O
to	O
research	O
topics	O
in	O
object-oriented	B-Language
language	I-Language
design	O
.	O
</s>
<s>
Some	O
current	O
prototype-oriented	B-Application
languages	O
are	O
JavaScript	B-Language
(	O
and	O
other	O
ECMAScript	B-Language
implementations	O
such	O
as	O
JScript	B-Language
and	O
Flash	B-Operating_System
's	O
ActionScript	B-Operating_System
1.0	O
)	O
,	O
Lua	B-Language
,	O
Cecil	B-Language
,	O
NewtonScript	B-Device
,	O
Io	B-Application
,	O
Ioke	O
,	O
MOO	B-Application
,	O
REBOL	B-Application
and	O
AHK	B-Language
.	O
</s>
<s>
Advocates	O
of	O
prototype-based	B-Application
programming	I-Application
argue	O
that	O
it	O
encourages	O
the	O
programmer	B-Application
to	O
focus	O
on	O
the	O
behavior	O
of	O
some	O
set	O
of	O
examples	O
and	O
only	O
later	O
worry	O
about	O
classifying	O
these	O
objects	O
into	O
archetypal	O
objects	O
that	O
are	O
later	O
used	O
in	O
a	O
fashion	O
similar	O
to	O
classes	O
.	O
</s>
<s>
Many	O
prototype-based	B-Application
systems	O
encourage	O
the	O
alteration	O
of	O
prototypes	B-Application
during	O
run-time	B-Library
,	O
whereas	O
only	O
very	O
few	O
class-based	B-Application
object-oriented	B-Language
systems	O
(	O
such	O
as	O
the	O
dynamic	O
object-oriented	B-Language
system	O
,	O
Common	B-Language
Lisp	I-Language
,	O
Dylan	B-Language
,	O
Objective-C	B-Language
,	O
Perl	B-Language
,	O
Python	B-Language
,	O
Ruby	B-Language
,	O
or	O
Smalltalk	B-Application
)	O
allow	O
classes	O
to	O
be	O
altered	O
during	O
the	O
execution	O
of	O
a	O
program	O
.	O
</s>
<s>
Almost	O
all	O
prototype-based	B-Application
systems	O
are	O
based	O
on	O
interpreted	B-Application
and	O
dynamically	O
typed	O
languages	O
.	O
</s>
<s>
The	O
Omega	O
language	O
discussed	O
in	O
Prototype-Based	B-Application
Programming	I-Application
is	O
an	O
example	O
of	O
such	O
a	O
system	O
,	O
though	O
according	O
to	O
Omega	O
's	O
website	O
even	O
Omega	O
is	O
not	O
exclusively	O
static	O
,	O
but	O
rather	O
its	O
"	O
compiler	B-Language
may	O
choose	O
to	O
use	O
static	O
binding	O
where	O
this	O
is	O
possible	O
and	O
may	O
improve	O
the	O
efficiency	B-General_Concept
of	O
a	O
program.	O
"	O
</s>
<s>
In	O
prototype-based	B-Application
languages	I-Application
there	O
are	O
no	O
explicit	O
classes	O
.	O
</s>
<s>
Objects	O
inherit	O
directly	O
from	O
other	O
objects	O
through	O
a	O
prototype	B-Application
property	O
.	O
</s>
<s>
The	O
prototype	B-Application
property	O
is	O
called	O
prototype	B-Application
in	O
Self	B-Operating_System
and	O
JavaScript	B-Language
,	O
or	O
proto	O
in	O
Io	B-Application
.	O
</s>
<s>
The	O
former	O
is	O
supported	O
through	O
some	O
form	O
of	O
object	O
literal	O
,	O
declarations	O
where	O
objects	O
can	O
be	O
defined	O
at	B-Library
runtime	I-Library
through	O
special	O
syntax	O
such	O
as	O
 { ... } 	O
and	O
passed	O
directly	O
to	O
a	O
variable	O
.	O
</s>
<s>
In	O
class-based	B-Application
languages	I-Application
,	O
a	O
new	O
instance	O
is	O
constructed	O
through	O
a	O
class	O
's	O
constructor	O
function	O
,	O
a	O
special	O
function	O
that	O
reserves	O
a	O
block	O
of	O
memory	O
for	O
the	O
object	O
's	O
members	O
(	O
properties	O
and	O
methods	O
)	O
and	O
returns	O
a	O
reference	O
to	O
that	O
block	O
.	O
</s>
<s>
Systems	O
that	O
support	O
ex	O
nihilo	O
object	O
creation	O
allow	O
new	O
objects	O
to	O
be	O
created	O
from	O
scratch	O
without	O
cloning	O
from	O
an	O
existing	O
prototype	B-Application
.	O
</s>
<s>
In	O
many	O
prototype	B-Application
languages	O
there	O
exists	O
a	O
root	O
object	O
,	O
often	O
called	O
Object	O
,	O
which	O
is	O
set	O
as	O
the	O
default	O
prototype	B-Application
for	O
all	O
other	O
objects	O
created	O
in	O
run-time	B-Library
and	O
which	O
carries	O
commonly	O
needed	O
methods	O
such	O
as	O
a	O
toString( )	O
function	O
to	O
return	O
a	O
description	O
of	O
the	O
object	O
as	O
a	O
string	O
.	O
</s>
<s>
(	O
In	O
the	O
JavaScript	B-Language
language	I-Language
,	O
one	O
can	O
do	O
this	O
by	O
using	O
a	O
null	O
prototype	B-Application
,	O
i.e.	O
</s>
<s>
Cloning	O
refers	O
to	O
a	O
process	O
whereby	O
a	O
new	O
object	O
is	O
constructed	O
by	O
copying	O
the	O
behavior	O
of	O
an	O
existing	O
object	O
(	O
its	O
prototype	B-Application
)	O
.	O
</s>
<s>
In	O
some	O
systems	O
the	O
resulting	O
child	O
object	O
maintains	O
an	O
explicit	O
link	O
(	O
via	O
delegation	B-Application
or	O
resemblance	O
)	O
to	O
its	O
prototype	B-Application
,	O
and	O
changes	O
in	O
the	O
prototype	B-Application
cause	O
corresponding	O
changes	O
to	O
be	O
apparent	O
in	O
its	O
clone	O
.	O
</s>
<s>
Other	O
systems	O
,	O
such	O
as	O
the	O
Forth-like	O
programming	O
language	O
Kevo	O
,	O
do	O
not	O
propagate	O
change	O
from	O
the	O
prototype	B-Application
in	O
this	O
fashion	O
and	O
instead	O
follow	O
a	O
more	O
concatenative	O
model	O
where	O
changes	O
in	O
cloned	O
objects	O
do	O
not	O
automatically	O
propagate	O
across	O
descendants	O
.	O
</s>
<s>
In	O
prototype-based	B-Application
languages	I-Application
that	O
use	O
delegation	B-Application
,	O
the	O
language	O
runtime	B-Library
is	O
capable	O
of	O
dispatching	O
the	O
correct	O
method	O
or	O
finding	O
the	O
right	O
piece	O
of	O
data	O
simply	O
by	O
following	O
a	O
series	O
of	O
delegation	B-Application
pointers	O
(	O
from	O
object	O
to	O
its	O
prototype	B-Application
)	O
until	O
a	O
match	O
is	O
found	O
.	O
</s>
<s>
All	O
that	O
is	O
required	O
to	O
establish	O
this	O
behavior-sharing	O
between	O
objects	O
is	O
the	O
delegation	B-Application
pointer	O
.	O
</s>
<s>
Unlike	O
the	O
relationship	O
between	O
class	O
and	O
instance	O
in	O
class-based	B-Application
object-oriented	B-Language
languages	I-Language
,	O
the	O
relationship	O
between	O
the	O
prototype	B-Application
and	O
its	O
offshoots	O
does	O
not	O
require	O
that	O
the	O
child	O
object	O
have	O
a	O
memory	O
or	O
structural	O
similarity	O
to	O
the	O
prototype	B-Application
beyond	O
this	O
link	O
.	O
</s>
<s>
As	O
such	O
,	O
the	O
child	O
object	O
can	O
continue	O
to	O
be	O
modified	O
and	O
amended	O
over	O
time	O
without	O
rearranging	O
the	O
structure	O
of	O
its	O
associated	O
prototype	B-Application
as	O
in	O
class-based	B-Application
systems	O
.	O
</s>
<s>
For	O
this	O
reason	O
,	O
some	O
prototype-based	B-Application
languages	I-Application
refer	O
to	O
both	O
data	O
and	O
methods	O
as	O
"	O
slots	O
"	O
or	O
"	O
members	O
"	O
.	O
</s>
<s>
In	O
concatenative	O
prototyping	O
-	O
the	O
approach	O
implemented	O
by	O
the	O
Kevo	O
programming	O
language	O
-	O
there	O
are	O
no	O
visible	O
pointers	O
or	O
links	O
to	O
the	O
original	O
prototype	B-Application
from	O
which	O
an	O
object	O
is	O
cloned	O
.	O
</s>
<s>
The	O
prototype	B-Application
(	O
parent	O
)	O
object	O
is	O
copied	O
rather	O
than	O
linked	O
to	O
and	O
there	O
is	O
no	O
delegation	B-Application
.	O
</s>
<s>
As	O
a	O
result	O
,	O
changes	O
to	O
the	O
prototype	B-Application
will	O
not	O
be	O
reflected	O
in	O
cloned	O
objects	O
.	O
</s>
<s>
The	O
main	O
conceptual	O
difference	O
under	O
this	O
arrangement	O
is	O
that	O
changes	O
made	O
to	O
a	O
prototype	B-Application
object	O
are	O
not	O
automatically	O
propagated	O
to	O
clones	O
.	O
</s>
<s>
(	O
However	O
,	O
Kevo	O
does	O
provide	O
additional	O
primitives	O
for	O
publishing	O
changes	O
across	O
sets	O
of	O
objects	O
based	O
on	O
their	O
similarity	O
—	O
so-called	O
family	O
resemblances	O
or	O
clone	O
family	O
mechanism	O
—	O
rather	O
than	O
through	O
taxonomic	O
origin	O
,	O
as	O
is	O
typical	O
in	O
the	O
delegation	B-Application
model	O
.	O
)	O
</s>
<s>
It	O
is	O
also	O
sometimes	O
claimed	O
that	O
delegation-based	O
prototyping	O
has	O
an	O
additional	O
disadvantage	O
in	O
that	O
changes	O
to	O
a	O
child	O
object	O
may	O
affect	O
the	O
later	O
operation	O
of	O
the	O
parent	O
.	O
</s>
<s>
However	O
,	O
this	O
problem	O
is	O
not	O
inherent	O
to	O
the	O
delegation-based	O
model	O
and	O
does	O
not	O
exist	O
in	O
delegation-based	O
languages	O
such	O
as	O
JavaScript	B-Language
,	O
which	O
ensure	O
that	O
changes	O
to	O
a	O
child	O
object	O
are	O
always	O
recorded	O
in	O
the	O
child	O
object	O
itself	O
and	O
never	O
in	O
parents	O
(	O
i.e.	O
</s>
<s>
In	O
simplistic	O
implementations	O
,	O
concatenative	O
prototyping	O
will	O
have	O
faster	O
member	O
lookup	O
than	O
delegation-based	O
prototyping	O
(	O
because	O
there	O
is	O
no	O
need	O
to	O
follow	O
the	O
chain	O
of	O
parent	O
objects	O
)	O
,	O
but	O
will	O
conversely	O
use	O
more	O
memory	O
(	O
because	O
all	O
slots	O
are	O
copied	O
,	O
rather	O
than	O
there	O
being	O
a	O
single	O
slot	O
pointing	O
to	O
the	O
parent	O
object	O
)	O
.	O
</s>
<s>
For	O
example	O
,	O
systems	O
with	O
concatenative	O
prototyping	O
can	O
use	O
a	O
copy-on-write	B-Language
implementation	O
to	O
allow	O
for	O
behind-the-scenes	O
data	O
sharing	O
—	O
and	O
such	O
an	O
approach	O
is	O
indeed	O
followed	O
by	O
Kevo	O
.	O
</s>
<s>
Conversely	O
,	O
systems	O
with	O
delegation-based	O
prototyping	O
can	O
use	O
caching	B-General_Concept
to	O
speed	O
up	O
data	O
lookup	O
.	O
</s>
<s>
Advocates	O
of	O
class-based	B-Application
object	O
models	O
who	O
criticize	O
prototype-based	B-Application
systems	O
often	O
have	O
concerns	O
similar	O
to	O
the	O
concerns	O
that	O
proponents	O
of	O
static	O
type	O
systems	O
for	O
programming	O
languages	O
have	O
of	O
dynamic	O
type	O
systems	O
(	O
see	O
datatype	O
)	O
.	O
</s>
<s>
Usually	O
,	O
such	O
concerns	O
involve	O
correctness	O
,	O
safety	B-Language
,	O
predictability	O
,	O
efficiency	B-General_Concept
and	O
programmer	B-Application
unfamiliarity	O
.	O
</s>
<s>
On	O
the	O
first	O
three	O
points	O
,	O
classes	O
are	O
often	O
seen	O
as	O
analogous	O
to	O
types	O
(	O
in	O
most	O
statically	O
typed	O
object-oriented	B-Language
languages	I-Language
they	O
serve	O
that	O
role	O
)	O
and	O
are	O
proposed	O
to	O
provide	O
contractual	O
guarantees	O
to	O
their	O
instances	O
,	O
and	O
to	O
users	O
of	O
their	O
instances	O
,	O
that	O
they	O
will	O
behave	O
in	O
some	O
given	O
fashion	O
.	O
</s>
<s>
Regarding	O
efficiency	B-General_Concept
,	O
declaring	O
classes	O
simplifies	O
many	O
compiler	B-Language
optimizations	O
that	O
allow	O
developing	O
efficient	O
method	O
and	O
instance-variable	O
lookup	O
.	O
</s>
<s>
For	O
the	O
Self	B-Operating_System
language	O
,	O
much	O
development	O
time	O
was	O
spent	O
on	O
developing	O
,	O
compiling	B-Language
,	O
and	O
interpreting	O
techniques	O
to	O
improve	O
the	O
performance	O
of	O
prototype-based	B-Application
systems	O
versus	O
class-based	B-Application
systems	O
.	O
</s>
<s>
A	O
common	O
criticism	O
made	O
against	O
prototype-based	B-Application
languages	I-Application
is	O
that	O
the	O
community	O
of	O
software	B-Application
developers	I-Application
is	O
unfamiliar	O
with	O
them	O
,	O
despite	O
the	O
popularity	O
and	O
market	O
permeation	O
of	O
JavaScript	B-Language
.	O
</s>
<s>
However	O
,	O
knowledge	O
about	O
prototype-based	B-Application
systems	O
is	O
increasing	O
with	O
the	O
proliferation	O
of	O
JavaScript	B-Application
frameworks	I-Application
and	O
the	O
complex	O
use	O
of	O
JavaScript	B-Language
as	O
the	O
World	O
Wide	O
Web	O
(	O
Web	O
)	O
matures	O
.	O
</s>
<s>
ECMAScript	B-Language
6	O
introduced	O
classes	O
as	O
syntactic	O
sugar	O
over	O
JavaScript	B-Language
's	O
existing	O
prototype-based	B-Application
inheritance	B-Language
,	O
providing	O
an	O
alternative	O
way	O
to	O
create	O
objects	O
and	O
manage	O
inheritance	B-Language
.	O
</s>
<s>
Python	B-Language
with	O
.	O
</s>
<s>
Snap	B-Application
!	I-Application
</s>
