Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
211bdd9d
Commit
211bdd9d
authored
Jun 27, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More doc updates.
parent
7fbaeb4d
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
22 deletions
+45
-22
post.html
doc/_layouts/post.html
+1
-1
cxx.md
doc/cxx.md
+4
-0
index.md
doc/index.md
+4
-5
install.md
doc/install.md
+11
-11
language.md
doc/language.md
+1
-1
otherlang.md
doc/otherlang.md
+24
-4
No files found.
doc/_layouts/post.html
View file @
211bdd9d
...
...
@@ -3,7 +3,7 @@
<div
class=
"hmargin"
style=
"float: right"
><a
class=
"groups_link"
style=
"color: #fff"
href=
"https://groups.google.com/group/capnproto-announce"
>
Stay Updated
</a></div>
<h1>
News
</h1>
<h1>
<a
href=
"/news/"
>
News
</a>
</h1>
<h2>
{{ page.title }}
</h2>
<p
class=
"author"
>
...
...
doc/cxx.md
View file @
211bdd9d
...
...
@@ -542,6 +542,10 @@ Notes about the dynamic API:
and even enum types and
`DynamicEnum`
. Finally, all valid Cap'n Proto field types may be
implicitly converted to
`DynamicValue`
.
*
You can load schemas dynamically at runtime using
`SchemaLoader`
(
`capnp/schema-loader.h`
) and
use the Dynamic API to manipulate objects of these types.
`MessageBuilder`
and
`MessageReader`
have methods for accessing the message root using a dynamic schema.
*
Unlike with Protobufs, there is no "global registry" of compiled-in types. To get the schema
for a compiled-in type, use
`capnp::Schema::from<MyType>()`
.
...
...
doc/index.md
View file @
211bdd9d
...
...
@@ -78,11 +78,10 @@ I no longer work for Google. Cap'n Proto is not affiliated with Google or any ot
**_OK, how do I get started?_**
At this time, Cap'n Proto is not ready for production use. Feel free to
[
play around with the code and run the benchmarks
](
install.html
)
, but note that it's incomplete
and buggy. If you'd like to help hack on Cap'n Proto, such as by writing bindings in other
languages, let us know on the
[
discussion group
](
https://groups.google.com/group/capnproto
)
. If
you'd just like to know when it's ready, add yourself to the
To install Cap'n Proto, head over to the
[
installation page
](
install.html
)
. If you'd like to help
hack on Cap'n Proto, such as by writing bindings in other languages, let us know on the
[
discussion group
](
https://groups.google.com/group/capnproto
)
. If you'd like to receive e-mail
udpates about future releases, add yourself to the
[
announcement list
](
https://groups.google.com/group/capnproto-announce
)
.
{% include buttons.html %}
doc/install.md
View file @
211bdd9d
...
...
@@ -13,9 +13,9 @@ As of this writing, Cap'n Proto is in beta. The serialization layer is close to
and we don't anticipate any further changes to the wire format. That said, if you want to use it,
you should keep in mind some caveats:
*
**Security:**
Although Kenton has some background in security, there are almost certainly a few
exploitable security bugs in the Cap'n Proto code. You should not use Cap'n Proto on untrusted
data until a proper security review has been completed
.
*
**Security:**
Cap'n Proto has not yet had a security review. Although Kenton has a background
in security and is not aware of any vulnerabilities in the current code, it's likely that there
are a few. For now, do not accept Cap'n Proto messages from parties you do not trust
.
*
**API Stability:**
The Cap'n Proto programming interface may still change in ways that break
existing code. Such changes are likely to be minor and should not affect the wire format.
*
**Performance:**
While Cap'n Proto is inherently fast by design, the implementation has not yet
...
...
@@ -42,8 +42,8 @@ First, install [Cabal](http://www.haskell.org/cabal/), e.g. on Ubuntu:
Now you can download and install the release tarball:
curl -O [TODO: URL]
cabal install capnproto-compiler-0.1.0.tar.gz
<pre><code>
curl -O
<a
href=
"http://capnproto.org/capnproto-compiler-0.1.0.tar.gz"
>
http://capnproto.org/capnproto-compiler-0.1.0.tar.gz
</a>
cabal install capnproto-compiler-0.1.0.tar.gz
</code></pre>
Be sure that the Cabal bin directory (e.g.
`$HOME/.cabal/bin`
on Ubuntu or
`$HOME/Library/Haskell/bin`
on Mac OSX) is in your
`PATH`
before you attempt to build the C++
...
...
@@ -114,12 +114,12 @@ from Git, you must install the runtime from Git.
You may download and install the release version of the C++ runtime like so:
curl -O [TODO: URL]
tar zxv
f capnproto-c++-0.1.0.tar.gz
cd capnproto-c++-0.1.0
./configure
make -j6 check
sudo make install
<pre><code>
curl -O
<a
href=
"http://capnproto.org/capnproto-c++-0.1.0.tar.gz"
>
http://capnproto.org/capnproto-c++-0.1.0.tar.gz
</a>
tar zx
f capnproto-c++-0.1.0.tar.gz
cd capnproto-c++-0.1.0
./configure
make -j6 check
sudo make install
</code></pre>
This will install
`libcapnp`
in
`/usr/local/lib`
and headers in
`/usr/local/include/capnp`
and
`/usr/local/include/kj`
.
...
...
doc/language.md
View file @
211bdd9d
...
...
@@ -2,7 +2,7 @@
layout
:
page
---
#
Defining Types
#
Schema Language
Like Protocol Buffers and Thrift (but unlike JSON or MessagePack), Cap'n Proto messages are
strongly-typed and not self-describing. You must define your message structure in a special
...
...
doc/otherlang.md
View file @
211bdd9d
...
...
@@ -40,11 +40,11 @@ The Cap'n Proto compiler / code generator binary, `capnpc`, supports a "plugin"
custom code generators. Plugins are independent executables (written in any language) which read
a description of the schema from standard input and then generate the necessary code. The
description is itself a Cap'n Proto message, defined by
[
schema.capnp
](
https://github.com/kentonv/capnproto/blob/master/c%2B%2B/src/capnproto/schema.capnp
)
(the file will move to a better location eventually). Specifically, the plugin receives a
`CodeGeneratorRequest`
, using
[
schema.capnp
](
https://github.com/kentonv/capnproto/blob/master/c%2B%2B/src/capnp/schema.capnp
)
.
Specifically, the plugin receives a
`CodeGeneratorRequest`
, using
[
standard serialization
](
http://kentonv.github.io/capnproto/encoding.html#serialization_over_a_stream
)
(not packed).
(not packed). (Note that installing the C++ runtime causes schema.capnp to be placed in
`$PREFIX/include/capnp`
--
`/usr/local/include/capnp`
by default).
Of course, because the input to a plugin is itself in Cap'n Proto format, if you write your
plugin directly in the language you wish to support, you may have a bootstrapping problem: you
...
...
@@ -69,3 +69,23 @@ as the working directory, so you do not need to worry about this.
[
This example plugin
](
https://github.com/kentonv/capnproto/blob/master/c%2B%2B/src/capnp/compiler/capnpc-capnp.c%2B%2B
)
writes the schema back to standard output in Cap'n Proto schema language, similar to what
`capnpc -v`
does.
### Supporting Dynamic Languages
Dynamic languages have no compile step. This makes it difficult to work
`capnpc`
into the workflow
for such languages. Additionally, dynamic languages are often scripting languages that do not
support pointer arithmetic or any reasonably-performant alternative.
Fortunately, dynamic languages usually have facilities for calling native code. The best way to
support Cap'n Proto in a dynamic language, then, is to wrap the C++ library, in particular the
[
C++ dynamic API
](
cxx.html#dynamic_reflection
)
. This way you get reasonable performance while
still avoiding the need to generate any code specific to each schema.
Of course, you still need to parse the schema. As of v0.1, the C++ runtime only has the ability
to load schemas that have already been parsed and translated to a binary format (defined by
`schema.capnp`
, the same format used by compiler plugins). It cannot parse
`.capnp`
files directly.
In a future version of Cap'n Proto, the schema parser will be rewritten from Haskell to C++ to
solve this problem. For now, you can hack around it by invoking
`capnpc`
as a subprocess. Running
`capnpc -o/bin/cat myschema.capnp`
, for example, will cause
`capnpc`
to invoke
`cat`
as if it were
a compiler plugin causing the compiled schemas to be written back to stdout, from which your calling
process can parse and load them.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment