--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+...@googlegroups.com.
Visit this group at http://groups.google.com/group/capnproto.
God this turned out to be quite a long one. I was meaning to write an email directly to you with some of my thoughts / motivations. However since we have begun tackling this stuff here I’ve done a brain dump of all the stuff I wanted to get across. The short version addresses your question, the rest is my brain dump :D
The short version and current needs:
My current use-case would be satisfied by altering an existing node in a non breaking/compatible way. I might just be covered by only the ability to add fields to structs. I will be using capn files to generate the basic types at the moment.
However, i'm hoping to convince you to build a whole API for building schemas dynamically :D
The long version.
Premise
protobuf and capnp have a very general description model that can cover pretty much any data modelling need. Combined with there respective DSL's They do this well at the compile time level, and they can work with existing messages dynamically at runtime. But they cannot form the backbone of a system that wants to use them without the underlying description language / filesystem.
Motivation
If you remove the notion that schemas are backed by files (in later stages of the compilation), and relax the notion that the capnp DSL defines the AST, the AST/compilation model simplifies to the point where it easy to provide an API for client tools.
This leads to capnp providing a low level programatic AST for general type schemas, that can be manipulated, stored by client tools whilst still being able interoperate with the compile time concepts of capnp.
If capnp catered for the above style of being a unified AST divorced from capnp files, it opens up the following use-cases:
0. As a central AST to represent translating data formats.
Perhaps the most important use-case: BSON, protobof, msgpack, thrift, json and a zillion other data formats out there. need to be interoped with. This functionality has advantages for capnp uptake.
My motivations for this differ tho, if I can’t find an implementation for capnp for a certain language, or if I can’t handle the verbose and fiddly nature of constructing capnp messages in certain languages, I should be able to fall back onto BSON, especially since it’s so easy to work with, perhaps users of my system would think this was as well.
The protobuf wire format also has some advantages compared to capn in terms of how messages are constructed as well as the encoding format. I think capnp could do with protobuf style message building layer. I will make another post about this.
1. Fully Dynamic DDL for use in a system with a database as a backing store for schemas:
Integration with a processing engine, or a database. I.e., CREATE, DROP, ALTER commands for building Structs that are enclosed in a database concept of a file (database name ? ). Client will probably need a AST for a data representation model, as well as a data model. capnp can do both. An example for data model needs could be DROP -ing a struct should lead to cascading drops.
2. Embedded schemas.
I came up with the following way of writing an embedded schema a few days ago (https://gist.github.com/hsyed/7246093).
Generating an embeddable representation of the schema is highly desired in what I am doing. It removes the need for parsing a capnp file, or having to compile in c++ into message sources. An additional performance advantage is the removal of the step of acquiring the field types by doing string lookups against the dynamic schema. If you can embed the schema you can declare the fields apriori. The end goal of what I am working on will send a schema to message source providers, embedding schemas is an interim solution.
3. Dynamic Languages / metaprogramming - Dynamic data, Dynamic interfaces.
This goes beyond my data oriented needs. However being able to generate the data structures, and interfaces at runtime at a low level would be a big win / game changer. Sure you can do this by piggy backing off a level of indirection built on top of capn. However, if you had the right tools to create this stuff dynamically in a low level tool, the possibilities are endless. This is both for compile time and for runtime.
1. Template expression based DSL in C++/Scala for specifying an RPC system and interchange format without having to rely on a capnp file ? Client runtime would infer everything form the server.
Conclusion and my work.
I’d like to work on some of this stuff, I’ve got my head around the majority of the codebase. I read somewhere that you are considering tackling storage concerns with capn. I’m highly motivated with what you are planning to do with that.
I’m exploring reimplementing a fully dynamic complex event processing system / toolchain with automaton based pattern detection, activate database functionality, as well as traditional storage of events in a relational manner, in a highly symbolised compact format.
This should give you some insight as to why I want to with a dynamic capnp that can alter the schemas as runtime. The whole system is a pipeline of processing. being able to add stuff during the stages is vital. You specify what an event looks like at source, and the rest of the system builds on that definition. You also need as much flexibility as possible whilst bootstrapping the system, which is why I mentioned points 0,2 :D
My current use-case would be satisfied by altering an existing node in a non breaking/compatible way. I might just be covered by only the ability to add fields to structs. I will be using capn files to generate the basic types at the moment.
Premise
protobuf and capnp have a very general description model that can cover pretty much any data modelling need. Combined with there respective DSL's They do this well at the compile time level, and they can work with existing messages dynamically at runtime. But they cannot form the backbone of a system that wants to use them without the underlying description language / filesystem.
0. As a central AST to represent translating data formats.
Perhaps the most important use-case: BSON, protobof, msgpack, thrift, json and a zillion other data formats out there. need to be interoped with. This functionality has advantages for capnp uptake.
The protobuf wire format also has some advantages compared to capn in terms of how messages are constructed as well as the encoding format. I think capnp could do with protobuf style message building layer. I will make another post about this.
1. Fully Dynamic DDL for use in a system with a database as a backing store for schemas:
2. Embedded schemas.
3. Dynamic Languages / metaprogramming - Dynamic data, Dynamic interfaces.