Hacker News new | ask | show | jobs
by limejuice 4698 days ago
The name Cap'n Proto is bit strange. The name makes me thing of CAP'N CRUNCH CEREAL and prototyping, but then I read about the connection to protocol buffers. Might want to think of a different name, e.g. Zero Data X "zero cost data interchange" or something.

I am using JSON to save structured data for an application, and this is interesting, although my app doesn't spend alot of time encoding/deconding the JSON since the data structures are fairly simple.

If I wanted to use this for Java, wouldn't there still be decode step to convert the fields into java objects?

2 comments

The name makes me thing of CAP'N CRUNCH CEREAL... Might want to think of a different name

But... It's a cerealization protocol. :P

If I wanted to use this for Java, wouldn't there still be decode step to convert the fields into java objects?

Not necessarily. Your generated Java object could just contain a (ByteBuffer, int offset) pair. All the getter/setter methods then just write through to the underlying ByteBuffer.

http://docs.oracle.com/javase/1.4.2/docs/api/java/nio/ByteBu... is solid enough reading for the interested in encoding/decoding. It compares Direct v.s. non-direct buffers. The doc does remain somewhat circumspect about whether any work is done converting from raw memory to primitive values, for example in the use of getLong or putLong to read or write.
JSON makes me think of the Argonauts. They should probably change the name to something like "Language-agnostic hash-based data interchange format" or something.

In all seriousness, if you're familiar with protobuf the name seems reasonable enough. If you aren't, I guess you're not entirely the target audience.