<s>
Cap’n	O
Proto	O
is	O
a	O
data	B-Application
serialization	I-Application
format	O
and	O
Remote	B-Operating_System
Procedure	I-Operating_System
Call	I-Operating_System
(	O
RPC	B-Operating_System
)	O
framework	O
for	O
exchanging	O
data	O
between	O
computer	O
programs	O
.	O
</s>
<s>
The	O
high-level	O
design	O
focuses	O
on	O
speed	O
and	O
security	O
,	O
making	O
it	O
suitable	O
for	O
network	O
as	O
well	O
as	O
inter-process	B-Operating_System
communication	I-Operating_System
.	O
</s>
<s>
Cap'n	B-Operating_System
Proto	I-Operating_System
was	O
created	O
by	O
the	O
former	O
maintainer	O
of	O
Google	O
's	O
popular	O
Protocol	B-Protocol
Buffers	I-Protocol
framework	O
(	O
Kenton	O
Varda	O
)	O
and	O
was	O
designed	O
to	O
avoid	O
some	O
of	O
its	O
perceived	O
shortcomings	O
.	O
</s>
<s>
Like	O
most	O
RPC	B-Operating_System
frameworks	O
dating	O
as	O
far	O
back	O
as	O
Sun	B-Protocol
RPC	I-Protocol
and	O
OSF	B-General_Concept
DCE	I-General_Concept
RPC	I-General_Concept
(	O
and	O
their	O
object-based	O
descendants	O
CORBA	B-Architecture
and	O
DCOM	B-Operating_System
)	O
,	O
Cap'n	B-Operating_System
Proto	I-Operating_System
uses	O
an	O
Interface	B-General_Concept
Description	I-General_Concept
Language	I-General_Concept
(	O
IDL	B-General_Concept
)	O
to	O
generate	O
RPC	B-Operating_System
libraries	O
in	O
a	O
variety	O
of	O
programming	O
languages	O
-	O
automating	O
many	O
low	O
level	O
details	O
such	O
as	O
handling	O
network	O
requests	O
,	O
converting	O
between	O
data	O
types	O
,	O
etc	O
.	O
</s>
<s>
The	O
Cap'n	B-Operating_System
Proto	I-Operating_System
interface	O
schema	O
uses	O
a	O
C-like	B-Language
syntax	I-Language
and	O
supports	O
common	O
primitives	O
data	O
types	O
(	O
booleans	O
,	O
integers	O
,	O
floats	O
,	O
etc	O
.	O
</s>
<s>
)	O
,	O
compound	O
types	O
(	O
structs	O
,	O
lists	O
,	O
enums	O
)	O
,	O
as	O
well	O
as	O
generics	B-Language
and	O
dynamic	O
types	O
.	O
</s>
<s>
Cap'n	B-Operating_System
Proto	I-Operating_System
also	O
supports	O
Object	O
Oriented	O
features	O
such	O
as	O
multiple	O
inheritance	O
,	O
which	O
has	O
been	O
criticized	O
for	O
its	O
complexity	O
.	O
</s>
<s>
Values	O
in	O
Cap'n	B-Operating_System
Proto	I-Operating_System
messages	O
are	O
represented	O
in	O
binary	O
,	O
as	O
opposed	O
to	O
text	O
encoding	O
used	O
by	O
"	O
human-readable	B-General_Concept
"	O
formats	O
such	O
as	O
JSON	B-General_Concept
or	O
XML	B-Protocol
.	O
</s>
<s>
Cap'n	B-Operating_System
Proto	I-Operating_System
tries	O
to	O
make	O
the	O
storage/network	O
protocol	O
appropriate	O
as	O
an	O
in-memory	O
format	O
,	O
so	O
that	O
no	O
translation	O
step	O
is	O
needed	O
when	O
reading	O
data	O
into	O
memory	O
or	O
writing	O
data	O
out	O
of	O
memory	O
.	O
</s>
<s>
When	O
the	O
in-memory	O
and	O
wire-protocol	O
representations	O
match	O
,	O
Cap'n	B-Operating_System
Proto	I-Operating_System
can	O
avoid	O
copying	O
and	O
encoding	O
data	O
when	O
creating	O
or	O
reading	O
a	O
message	O
and	O
instead	O
point	O
to	O
the	O
location	O
of	O
the	O
value	O
in	O
memory	O
.	O
</s>
<s>
Cap'n	B-Operating_System
Proto	I-Operating_System
also	O
supports	O
random	O
access	O
to	O
data	O
,	O
meaning	O
that	O
any	O
field	O
can	O
be	O
read	O
without	O
having	O
to	O
read	O
the	O
entire	O
message	O
.	O
</s>
<s>
Unlike	O
other	O
binary	O
serialization	B-Application
protocols	O
such	O
as	O
XMI	B-Protocol
,	O
Cap'n	B-Operating_System
Proto	I-Operating_System
considers	O
fine-grained	O
data	O
validation	O
at	O
the	O
RPC	B-Operating_System
level	O
an	O
anti-feature	O
that	O
limits	O
a	O
protocols	O
ability	O
to	O
evolve	O
.	O
</s>
<s>
Cap'n	B-Operating_System
Proto	I-Operating_System
schemas	O
are	O
designed	O
to	O
be	O
flexible	O
as	O
possible	O
and	O
pushes	O
data	O
validation	O
to	O
the	O
application	O
level	O
,	O
allowing	O
arbitrary	O
renaming	O
of	O
fields	O
,	O
adding	O
new	O
fields	O
,	O
and	O
making	O
concrete	O
types	O
generic	O
Cap'n	B-Operating_System
Proto	I-Operating_System
does	O
,	O
however	O
,	O
validate	O
pointer	O
bounds	O
and	O
type	O
check	O
individual	O
values	O
when	O
they	O
are	O
first	O
accessed	O
.	O
</s>
<s>
Cap'n	B-Operating_System
Proto	I-Operating_System
protocol	O
is	O
theoretically	O
suitable	O
for	O
very	O
fast	O
inter-process	B-Operating_System
communication	I-Operating_System
(	O
IPC	O
)	O
via	O
immutable	O
shared	O
memory	O
,	O
but	O
as	O
of	O
October	O
2020	O
none	O
of	O
the	O
implementations	O
support	O
data	O
passing	O
via	O
shared	O
memory	O
.	O
</s>
<s>
However	O
,	O
Cap'n	B-Operating_System
Proto	I-Operating_System
is	O
still	O
generally	O
considered	O
faster	O
than	O
Protocol	B-Protocol
Buffers	I-Protocol
and	O
similar	O
RPC	B-Operating_System
libraries	O
.	O
</s>
<s>
Cap'n	B-Operating_System
Proto	I-Operating_System
RPC	B-Operating_System
is	O
network	O
aware	O
:	O
supporting	O
both	O
handling	O
of	O
disconnects	O
and	O
promise	B-Operating_System
pipelining	I-Operating_System
,	O
wherein	O
a	O
server	O
pipes	O
the	O
output	O
of	O
one	O
function	O
into	O
another	O
function	O
.	O
</s>
<s>
Cap'n	B-Operating_System
Proto	I-Operating_System
can	O
be	O
layered	O
on	O
top	O
of	O
TLS	O
and	O
support	O
for	O
the	O
Noise	O
Protocol	O
Framework	O
is	O
on	O
the	O
roadmap	O
.	O
</s>
<s>
Cap'n	B-Operating_System
Proto	I-Operating_System
RPC	B-Operating_System
is	O
transport	O
agnostic	O
,	O
with	O
the	O
mainline	O
implementation	O
supporting	O
WebSockets	O
,	O
HTTP	O
,	O
TCP	O
,	O
and	O
UDP	O
.	O
</s>
<s>
The	O
Cap'n	B-Operating_System
Proto	I-Operating_System
RPC	B-Operating_System
standard	O
has	O
a	O
rich	O
capability	O
security	O
model	O
based	O
on	O
the	O
CapTP	O
protocol	O
used	O
by	O
the	O
E	B-Language
programming	I-Language
language	I-Language
.	O
</s>
<s>
Cap'n	B-Operating_System
Proto	I-Operating_System
was	O
originally	O
created	O
for	O
Sandstorm.io,	O
a	O
startup	O
offering	O
a	O
web	O
application	O
hosting	O
platform	O
with	O
capability-based	O
security	O
.	O
</s>
<s>
After	O
Sandstorm.io	O
failed	O
commercially	O
,	O
the	O
development	O
team	O
was	O
acqui-hired	O
by	O
Cloudflare	O
;	O
which	O
uses	O
Cap'n	B-Operating_System
Proto	I-Operating_System
internally	O
.	O
</s>
