capnproto README

The project's README from github.com/capnproto/capnproto. As one markdown file: README.md.

THIS IS THE V2 DEVELOPMENT BRANCH

On this branch, we may make breaking changes to the API at any time. Do not use this branch if you want stability. If you want "1.0 plus bug fixes", use the master branch.

For more, see the 1.0 release announcement:

https://capnproto.org/news/2023-07-28-capnproto-1.0.html


Cap'n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster. In fact, in benchmarks, Cap'n Proto is INFINITY TIMES faster than Protocol Buffers.

Read more...

capnproto (capnproto/capnproto)

Searching Database…

13.2K ·GitHub
这是干什么用的?Cap'n Proto 是一种速度极快的数据交换格式,同时也是一个基于能力(capability)的 RPC 系统。可以把它理解成 JSON,只不过用的是二进制;或者理解成 Protocol Buffers,但速度更快。
那它是一个安装后直接运行的软件,还是要编进我自己代码里的库?它属于开发者基础设施:这个仓库提供核心工具和 C++ 库,你需要把库链接进自己的程序里。这里并没有面向最终用户的应用。
我怎么把它装上?在 Unix 上,用标准的 autotools 流程编译发布版源码包(./configure、make、sudo make install),或者直接装包:apt-get install capnproto、pacman -S capnproto 或 brew install capnp。Windows 用户可以下载预编译好的 Win32 压缩包(里面带 capnp.exe),并用 Visual Studio 里的 CMake 来编译库。
编译之前我需要先装好哪些东西?需要一个较新的 C++ 编译器——代码用到了 C++14 特性,所以至少要 GCC 7.0、Clang 6.0 或 Visual Studio 2019。如果你不是用源码包而是从 Git 构建的,还需要 GNU autotools(autoconf、automake、libtool)。
我想要稳定的版本,应该用哪个分支?不是这个——默认分支是 V2 开发分支,随时可能出现破坏性的 API 变动。要稳定的话,README 推荐你用 master 分支,它的定位是“1.0 加上漏洞修复”。
“基于能力的 RPC”实际上是什么意思?除了序列化普通数据之外,RPC 层还允许服务器把远程对象的引用——“能力”——分发给客户端,客户端可以像调用本地接口一样调用它们,甚至在请求还没完全送达之前,结果就能通过管道传回来。它是系统的一等公民,并且是为 Sandstorm 和 Cloudflare Workers 这类对安全敏感的环境而构建的。
二进制格式要我自己手写,还是有现成的模式编译器?有编译器。你在 .capnp 模式文件里描述自己的数据结构和接口,仓库自带的 capnp 工具会把它们编译成你所用语言的源代码——这就是这个仓库里“核心工具”那部分。
除了 C++,我还能用其他语言使用它吗?这个仓库只是 C++ 参考实现。编译器可以搭配来自其他独立项目的插件使用,这些插件用其他语言实现了 Cap'n Proto,所以不管你用什么语言写代码,这套工具都能用。
Creator
capnproto
Size
26.3 MB
Stars
13.2K
Updated
CommitOct 13
Age
13y
Commits · 90 Days