annotate src/capnproto-0.6.0/doc/_posts/2014-12-15-capnproto-0.5-generics-msvc-java-csharp.md @ 83:ae30d91d2ffe

Replace these with versions built using an older toolset (so as to avoid ABI compatibilities when linking on Ubuntu 14.04 for packaging purposes)
author Chris Cannam
date Fri, 07 Feb 2020 11:51:13 +0000
parents 0994c39f1e94
children
rev   line source
cannam@62 1 ---
cannam@62 2 layout: post
cannam@62 3 title: "Cap'n Proto 0.5: Generics, Visual C++, Java, C#, Sandstorm.io"
cannam@62 4 author: kentonv
cannam@62 5 ---
cannam@62 6
cannam@62 7 Today we're releasing Cap'n Proto 0.5. We've added lots of goodies!
cannam@62 8
cannam@62 9 ### Finally: Visual Studio
cannam@62 10
cannam@62 11 Microsoft Visual Studio 2015 (currently in "preview") finally supports enough C++11 to get Cap'n
cannam@62 12 Proto working, and we've duly added official support for it!
cannam@62 13
cannam@62 14 Not all features are supported yet. The core serialization functionality sufficient for 90% of users
cannam@62 15 is available, but reflection and RPC APIs are not. We will turn on these APIs as soon as Visual C++
cannam@62 16 is ready (the main blocker is incomplete `constexpr` support).
cannam@62 17
cannam@62 18 As part of this, we now support CMake as a build system, and it can be used on Unix as well.
cannam@62 19
cannam@62 20 In related news, for Windows users not interested in C++ but who need the Cap'n Proto tools for
cannam@62 21 other languages, we now provide precompiled Windows binaries. See
cannam@62 22 [the installation page]({{site.baseurl}}install.html).
cannam@62 23
cannam@62 24 I'd like to thank [Bryan Boreham](https://github.com/bboreham),
cannam@62 25 [Joshua Warner](https://github.com/joshuawarner32), and [Phillip Quinn](https://github.com/pqu) for
cannam@62 26 their help in getting this working.
cannam@62 27
cannam@62 28 ### C#, Java
cannam@62 29
cannam@62 30 While not strictly part of this release, our two biggest missing languages recently gained support
cannam@62 31 for Cap'n Proto:
cannam@62 32
cannam@62 33 * [Marc Gravell](https://github.com/mgravell) -- the man responsible for the most popular C#
cannam@62 34 implementation of Protobufs -- has now implemented
cannam@62 35 [Cap'n Proto in C#](https://github.com/mgravell/capnproto-net).
cannam@62 36 * [David Renshaw](https://github.com/dwrensha), author of our existing Rust implementation and
cannam@62 37 [Sandstorm.io](https://sandstorm.io) core developer, has implemented
cannam@62 38 [Cap'n Proto in Java](https://github.com/dwrensha/capnproto-java).
cannam@62 39
cannam@62 40 ### Generics
cannam@62 41
cannam@62 42 Cap'n Proto now supports [generics]({{site.baseurl}}language.html#generic-types),
cannam@62 43 in the sense of Java generics or C++ templates. While working on
cannam@62 44 [Sandstorm.io](https://sandstorm.io) we frequently found that we wanted this, and it turned out
cannam@62 45 to be easy to support.
cannam@62 46
cannam@62 47 This is a feature which Protocol Buffers does not support and likely never will. Cap'n Proto has a
cannam@62 48 much easier time supporting exotic language features because the generated code is so simple. In
cannam@62 49 C++, nearly all Cap'n Proto generated code is inline accessor methods, which can easily become
cannam@62 50 templates. Protocol Buffers, in contrast, has generated parse and serialize functions and a host
cannam@62 51 of other auxiliary stuff, which is too complex to inline and thus would need to be adapted to
cannam@62 52 generics without using C++ templates. This would get ugly fast.
cannam@62 53
cannam@62 54 Generics are not yet supported by all Cap'n Proto language implementations, but where they are not
cannam@62 55 supported, things degrade gracefully: all type parameters simply become `AnyPointer`. You can still
cannam@62 56 use generics in your schemas as documentation. Meanwhile, at least our C++, Java, and Python
cannam@62 57 implementations have already been updated to support generics, and other implementations that
cannam@62 58 wrap the C++ reflection API are likely to work too.
cannam@62 59
cannam@62 60 ### Canonicalization
cannam@62 61
cannam@62 62 0.5 introduces a (backwards-compatible) change in
cannam@62 63 [the way struct lists should be encoded]({{site.baseurl}}encoding.html#lists), in
cannam@62 64 order to support [canonicalization]({{site.baseurl}}encoding.html#canonicalization).
cannam@62 65 We believe this will make Cap'n Proto more appropriate for use in cryptographic protocols. If
cannam@62 66 you've implemented Cap'n Proto in another language, please update your code!
cannam@62 67
cannam@62 68 ### Sandstorm and Capability Systems
cannam@62 69
cannam@62 70 [Sandstorm.io](https://sandstorm.io) is Cap'n Proto's parent project: a platform for personal
cannam@62 71 servers that is radically easier and more secure.
cannam@62 72
cannam@62 73 Cap'n Proto RPC is the underlying communications layer powering Sandstorm. Sandstorm is a
cannam@62 74 [capability system](http://www.erights.org/elib/capability/overview.html): applications can send
cannam@62 75 each other object references and address messages to those objects. Messages can themselves contain
cannam@62 76 new object references, and the recipient implicitly gains permission to use any object reference
cannam@62 77 they receive. Essentially, Sandstorm allows the interfaces between two apps, or between and app
cannam@62 78 and the platform, to be designed using the same vocabulary as interfaces between objects or
cannam@62 79 libraries in an object-oriented programming language (but
cannam@62 80 [without the mistakes of CORBA or DCOM]({{site.baseurl}}rpc.html#distributed-objects)).
cannam@62 81 Cap'n Proto RPC is at the core of this.
cannam@62 82
cannam@62 83 This has powerful implications: Consider the case of service discovery. On Sandstorm, all
cannam@62 84 applications start out isolated from each other in secure containers. However, applications can
cannam@62 85 (or, will be able to) publish Cap'n Proto object references to the system representing APIs they
cannam@62 86 support. Then, another app can make a request to the system, saying "I need an object that
cannam@62 87 implements interface Foo". At this point, the system can display a picker UI to the user,
cannam@62 88 presenting all objects the user owns that satisfy the requirement. However, the requesting app only
cannam@62 89 ever receives a reference to the object the user chooses; all others remain hidden. Thus, security
cannam@62 90 becomes "automatic". The user does not have to edit an ACL on the providing app, nor copy around
cannam@62 91 credentials, nor even answer any security question at all; it all derives automatically and
cannam@62 92 naturally from the user's choices. We call this interface "The Powerbox".
cannam@62 93
cannam@62 94 Moreover, because Sandstorm is fully aware of the object references held by every app, it will
cannam@62 95 be able to display a visualization of these connections, allowing a user to quickly see which of
cannam@62 96 their apps have access to each other and even revoke connections that are no longer desired with
cannam@62 97 a mouse click.
cannam@62 98
cannam@62 99 Cap'n Proto 0.5 introduces primitives to support "persistent" capabilities -- that is, the ability
cannam@62 100 to "save" an object reference to disk and then restore it later, on a different connection.
cannam@62 101 Obviously, the features described above totally depend on this feature.
cannam@62 102
cannam@62 103 The next release of Cap'n Proto is likely to include another feature essential for Sandstorm: the
cannam@62 104 ability to pass capabilities from machine to machine and have Cap'n Proto automatically form direct
cannam@62 105 connections when you do. This allows servers running on different machines to interact with each
cannam@62 106 other in a completely object-oriented way. Instead of passing around URLs (which necessitate a
cannam@62 107 global namespace, lifetime management, firewall traversal, and all sorts of other obstacles), you
cannam@62 108 can pass around capabilities and not worry about it. This will be central to Sandstorm's strategies
cannam@62 109 for federation and cluster management.
cannam@62 110
cannam@62 111 ### Other notes
cannam@62 112
cannam@62 113 * The C++ RPC code now uses `epoll` on Linux.
cannam@62 114 * We now test Cap'n Proto on Android and MinGW, in addition to Linux, Mac OSX, Cygwin, and Visual
cannam@62 115 Studio. (iOS and FreeBSD are also reported to work, though are not yet part of our testing
cannam@62 116 process.)