Hi Guys-

I'm thinking about implementing Cap'n Proto for hardware. I believe the 
lower encoding/decoding makes this viable for acceleration communication. 
There are, however, certain aspects of capnproto which are non-optimal for 
hardware. It would be nearly perfect with some additions to the type system:

   - A non-nullable, inline struct-like type. Basically, a C struct.
      - While CPUs are excellent at pointer dereferencing and manipulation, 
      that hardware is relatively expensive and very often unnecessary. 
Ideally, 
      for any fixed-size message, the individual field offsets would be 
      statically computable -- which they are except for structs. Groups don't 
      cut it since users want to reuse types. Elevating groups to a first-class 
      citizen would also work.
      - Also, there are applications where data is and used before the 
      message is entirely read to prevent requiring large buffers. Structs 
      sitting after that message's inline (non-pointer) data would prevent 
those 
      applications from using them or require potentially large re-ordering 
      buffers.
   - C-style arrays
      - Fixed-lenth arrays are quite common in hardware and it is, again, 
      very useful to be able to statically compute the offsets from the 
beginning 
      of the containing struct. The array length will be a capnp constant.
   - I know this is likely a non-starter, but generic types support for 
   non-pointer types and constants
      - To support the two above features
   
I realize that I *could* implement this via annotations and then require a 
custom transform or encoding of the messages, but that would have a 
performance and/or hardware area impact. I really want to just DMA messages 
out of host memory. I could also realize this with a custom c++ backend, 
but I'd like all the languages to eventually get this support. Imagine 
talking Cap'n Proto RPC directly to hardware from any language!

Is there any interest in adding these features to the spec? Are there 
complications of which I'm not aware? Am I misunderstanding something 
fundamental about Cap'n Proto?

~John

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/e9bf07d3-bfe3-42ac-8171-3b11b1e23073%40googlegroups.com.

Reply via email to