1. 11

    Author here! Happy to answer any questions.

    1. 4

      capnproto looks great, but also seems quite complicated internally on the RPC side. Do you think this hurts adoption in languages that are not C++? I know of a few reimplementations (in OCaml and rust) but it seems hard to reach level 3 or 4 of compatibility. Will 1.0 come with some RFCs or attempts to have a set of robust compatible implementations?

      1. 7

        I do think that’s a big problem, yes. The Cap’n Proto RPC design calls for a fairly complicated implementation in order to make life easy for the application developer. The new streaming stuff in particular managed to tickle a bunch of subtle message-ordering bugs inside even the C++ implementation. (Message ordering obviously matters a lot for streaming.)

        I’ve been thinking lately about how hard it would be to make the C++ RPC implementation reusable from other languages, so that the logic doesn’t need to be re-implemented. Interestingly, the API surface of the RPC layer is actually pretty small (this differs from the serialization layer, which has a wide API surface but very little implementation complexity). So I wonder if per-language serialization implementations can easily be paired with the C++ RPC state machine.

        Cap’n Proto serialization is actually rather ideally designed for exactly this, since the whole point of the zero-copy design is that messages in-memory are backed by a common memory layout. Sharing byte buffers between languages is pretty easy.

        Of course, I recognize that implementation heterogeneity is not a good thing in general. But I think it’s better than not having RPC implementations at all in most languages.

        1. 2

          I’d say you need to expose a C-compatible API, which is much easier to bind than C++ from most languages, and perhaps separate the project more explicitly from the codegen for C++ (which, after all, would just be one of the consumers of this common messaging API).

        2. 3

          I’d personally like to see some RFCs from something like this. It’s driven me to choose certain technologies over others in the past (ie. CBOR over MessagePack), and IMO it can help with diversifying implementation.

        3. 1

          I’ve implemented http-over-protobuf before and couldn’t find a nice reference implementation to emulate at the time. Was nice to read through the http-over-rpc capnproto schema and see all the features, corner cases, and optimizations I missed.

        1. 1

          Is this effectively what kubernetes does? Kube-proxy takes requests from nodes on its host and forwards them to services on other nodes?

          1. 1

            This isn’t really specific to Bastion, but there seems to be a new trend where everyone dual licenses their software. When I first got into free software, I always seem to remember reading this was bad and I shouldn’t do it. Has the wisdom changed and I just didn’t realize it? Or is everyone just no longer following the “rule” consequences be damned?

            1. 3

              I think it’s mostly a trend in rust projects because rust is licensed that way: https://internals.rust-lang.org/t/rationale-of-apache-dual-licensing/8952/5

              1. 3

                Dual licensing with what the language implementation project really wants plus something that accomplishes GPLv2 compatibility and the library ecosystem using the same licensing as the language implementation is not a new trend. It goes back all the way to Perl.

                1. 2

                  There’s been a cultural shift.

                  In part, it’s driven by the spate of companies selling OSS hosting - eg AWS taking the foss elasticsearch and selling it as a hosted service.

                  Quite a few people started to feel like they were spending their nights and weekends working in order to make money for someone who wasn’t contributing a commensurate amount back.

                  Another part is the growing realization that ‘pure-tech’ purpose-agnostic tools are being used in real life to eg put children in cages around the US. Lots of OSS authors have become particularly uncomfortable at the idea of their work reducing the cost of that.

                  There’s probably more to it than that, but I’ve definitely seen both of those reasons given.

                  1. 0

                    How is this relevant to the question asked? The Rust/Bastion license clearly isn’t part of the shift you are referring to.

                    1. 4

                      The question opened with

                      This isn’t really specific to Bastion, but there seems to be a new trend

                      That didn’t strike me as an attempt to find out about rust or bastion specifically.