cannam@62
|
1 ---
|
cannam@62
|
2 layout: page
|
cannam@62
|
3 title: Road Map
|
cannam@62
|
4 ---
|
cannam@62
|
5
|
cannam@62
|
6 # Road Map
|
cannam@62
|
7
|
cannam@62
|
8 This is a list of big ideas we'd like to implement in Cap'n Proto. We don't know in what order
|
cannam@62
|
9 these will actually happen; as always, real work is driven by real-world needs.
|
cannam@62
|
10
|
cannam@62
|
11 ### Language Features
|
cannam@62
|
12
|
cannam@62
|
13 * **Inline lists:** Lets you define a field composed of a fixed number of elements of the same
|
cannam@62
|
14 type, and have those elements be stored directly within the struct rather than as a separate
|
cannam@62
|
15 object. Useful mainly to avoid the need to validate list lengths when the length should always
|
cannam@62
|
16 be the same. Also saves a pointer's worth of space.
|
cannam@62
|
17 * **Type aliases:** Ability to define a type which is just an alias of some other type, and
|
cannam@62
|
18 have it show up as e.g. a `typedef` in languages that support that. (The current `using`
|
cannam@62
|
19 keyword is intended only for local use and does not affect code generation.)
|
cannam@62
|
20 * **Doc comments:** Harvest doc comments from schema files and use them to generate doc comments
|
cannam@62
|
21 on generated code. Also make them available in the compiled schema so that a documentation
|
cannam@62
|
22 generator could use them.
|
cannam@62
|
23 * **Encapsulated types:** This will allow you to create a hand-written wrapper around a
|
cannam@62
|
24 type which will be automatically injected into the generated code, so that you can provide a
|
cannam@62
|
25 nicer interface which encapsulates the type's inner state.
|
cannam@62
|
26 * **Maps:** Based on encapsulated and parameterized types.
|
cannam@62
|
27
|
cannam@62
|
28 ### RPC Protocol Features
|
cannam@62
|
29
|
cannam@62
|
30 * **Dynamic schema transmission:** Allow e.g. Python applications to obtain schemas directly from
|
cannam@62
|
31 the RPC server so that they need not have a local copy. Great for interactive debugging.
|
cannam@62
|
32 * **Three-way introductions (level 3 RPC):** Allow RPC interactions between more than two parties,
|
cannam@62
|
33 with new connections formed automatically as needed.
|
cannam@62
|
34 * **Bulk and Realtime**: Add features that make it easier to design Cap'n Proto APIs for bulk
|
cannam@62
|
35 data transfers (with flow control) and realtime communications (where it's better to drop
|
cannam@62
|
36 messages than to deliver them late).
|
cannam@62
|
37 * **UDP transport**: Cap'n Proto RPC could benefit from implementing a UDP transport, in order
|
cannam@62
|
38 to achieve zero-round-trip three-party introductions and to implement "realtime" APIs (see
|
cannam@62
|
39 "bulk and realtime", above).
|
cannam@62
|
40 * **Encrypted transport**: Cap'n Proto RPC should support an encrypted transport which uses
|
cannam@62
|
41 capability-based authorization (not PKI), can accomplish zero-round-trip three-party
|
cannam@62
|
42 introductions (via a pre-shared key from the introducer) and based on modern crypto. TLS is
|
cannam@62
|
43 not designed for this, but we don't want to invent new crypto; we intend to build on
|
cannam@62
|
44 [libsodium](https://github.com/jedisct1/libsodium) and the
|
cannam@62
|
45 [Noise Protocol Framework](http://noiseprotocol.org/) as much as possible.
|
cannam@62
|
46
|
cannam@62
|
47 ### C++ Cap'n Proto API Features
|
cannam@62
|
48
|
cannam@62
|
49 * **Plain Old C Structs:** The code generator should also generate a POCS type corresponding
|
cannam@62
|
50 to each struct type. The POCS type would use traditional memory allocation, thus would not
|
cannam@62
|
51 support zero-copy, but would support a more traditional and easy-to-use C++ API, including
|
cannam@62
|
52 the ability to mutate the object over time without convoluted memory management. POCS types
|
cannam@62
|
53 could be extracted from an inserted into messages with a single copy, allowing them to be
|
cannam@62
|
54 used easily in non-performance-critical code.
|
cannam@62
|
55 * **Multi-threading:** It should be made easy to assign different Cap'n Proto RPC objects
|
cannam@62
|
56 to different threads and have them be able to safely call each other. Each thread would still
|
cannam@62
|
57 have an anyschronous event loop serving the objects that belong to it.
|
cannam@62
|
58 * **Shared memory RPC:** Zero-copy inter-process communication.
|
cannam@62
|
59 * **JSON codec customization:** Extend the JSON library to support customizing the JSON
|
cannam@62
|
60 representation using annotations. For example, a field could be given a different name in
|
cannam@62
|
61 JSON than it is in Cap'n Proto. The goal of these features would be to allow any reasonable
|
cannam@62
|
62 pre-existing JSON schema to be representable as a Cap'n Proto type definition, so that
|
cannam@62
|
63 servers implementing JSON APIs can use Cap'n Proto exclusively on the server side.
|
cannam@62
|
64 * **LZ4 integration:** Integrate LZ4 compression into the API to further reduce bandwidth needs
|
cannam@62
|
65 with minimal CPU overhead.
|
cannam@62
|
66 * **Annotations API:** For each annotation definition, generate code which assists in extracting
|
cannam@62
|
67 that annotation from schema objects in a type-safe way.
|
cannam@62
|
68
|
cannam@62
|
69 ### C++ KJ API Features
|
cannam@62
|
70
|
cannam@62
|
71 KJ is a framework library that is bundled with Cap'n Proto, but is broadly applicable to C++
|
cannam@62
|
72 applications even if they don't use Cap'n Proto serialization.
|
cannam@62
|
73
|
cannam@62
|
74 * **Fiber-based concurrency:** The C++ runtime's event loop concurrency model will be augmented
|
cannam@62
|
75 with support for fibers, which are like threads except that context switches happen only at
|
cannam@62
|
76 well-defined points (thus avoiding the need for mutex locking). Fibers essentially provide
|
cannam@62
|
77 syntax sugar on top of the event loop model.
|
cannam@62
|
78 * **TLS bindings:** Write bindings for e.g. OpenSSL to make it easy to integrate with the KJ
|
cannam@62
|
79 I/O framework, Cap'n Proto RPC, and the KJ HTTP library.
|
cannam@62
|
80 * **Modern crypto bindings:** A thin wrapper around
|
cannam@62
|
81 [libsodium](https://github.com/jedisct1/libsodium) with a nice C++ API, e.g. representing
|
cannam@62
|
82 keys using fixed-size, trivially-copyable classes.
|
cannam@62
|
83 * **Event loop integrations:** We should provide off-the-shelf integrations with popular event
|
cannam@62
|
84 loop libraries, such as libuv, libev, libevent, boost::asio, and others, so that it's easier
|
cannam@62
|
85 to use Cap'n Proto RPC in applications that already use another event framework.
|
cannam@62
|
86
|
cannam@62
|
87 ### Storage
|
cannam@62
|
88
|
cannam@62
|
89 * **ORM interface:** Define a standard interface for capabilities that represent remotely-stored
|
cannam@62
|
90 objects, with get, put, publish, and subscribe methods. Ideally, parameterize this interface
|
cannam@62
|
91 on the stored type.
|
cannam@62
|
92 * **mmap-friendly mutable storage format:** Define a standard storage format that is friendly
|
cannam@62
|
93 to mmap-based use while allowing modification. (With the current serialization format, mmap
|
cannam@62
|
94 is only useful for read-only structures.) Possibly based on the ORM interface, updates only
|
cannam@62
|
95 possible at the granularity of a whole ORM entry.
|
cannam@62
|
96
|
cannam@62
|
97 ### Tools
|
cannam@62
|
98
|
cannam@62
|
99 * **Schema compatibility checker:** Add a `capnp` command which, given two schemas, verifies
|
cannam@62
|
100 that the latter is a compatible upgrade from the former. This could be used as a git hook
|
cannam@62
|
101 to prevent submission of schema changes that would break wire compatibility.
|
cannam@62
|
102 * **RPC debugger:** Add a `capnp` command which sends an RPC from the command line and prints
|
cannam@62
|
103 the result. Useful for debugging RPC servers.
|
cannam@62
|
104
|
cannam@62
|
105 ## Quality Assurance
|
cannam@62
|
106
|
cannam@62
|
107 These things absolutely must happen before any 1.0 release. Note that it's not yet decided when
|
cannam@62
|
108 a 1.0 release would happen nor how many 0.x releases might precede it.
|
cannam@62
|
109
|
cannam@62
|
110 * **Expand test coverage:** There are lots of tests now, but some important scenarios, such as
|
cannam@62
|
111 handling invalid of invalid input, need better testing.
|
cannam@62
|
112 * **Performance review:** Performance is already very good compared to competitors, but at some
|
cannam@62
|
113 point we need to break out the profiler and really hone down on the details.
|
cannam@62
|
114 * **Security review:** We need a careful security review to make sure malicious input cannot
|
cannam@62
|
115 crash an application or corrupt memory.
|
cannam@62
|
116
|
cannam@62
|
117 ### Infrastructure
|
cannam@62
|
118
|
cannam@62
|
119 Note: These are very large projects.
|
cannam@62
|
120
|
cannam@62
|
121 * **JSON-HTTP proxy:** Develop a web server which can expose a Cap'n Proto RPC backend as a
|
cannam@62
|
122 JSON-over-HTTP protocol.
|
cannam@62
|
123 * **Database:** A fast storage database based on Cap'n Proto which implements the ORM interface
|
cannam@62
|
124 on top of the mmap storage format.
|