3 ms·
I'll throw my hat into the ring as well. I've been building a new ad-hoc data format to replace JSON for a couple of years [1], and am nearing completion of th
by kstenerud 7y ago
I'll throw my hat into the ring as well.
I've been building a new ad-hoc data format to replace JSON for a couple of years [1], and am nearing completion of the reference implementation in go. It natively supports the following types:
* Nil : No data (NULL)
* Boolean : True or false
* Integer : Positive or negative, arbitrary size
* Float : Binary or decimal floating point, arbitrary size
* Time : Date, time, or timestamp, arbitrary size
* URI : RFC-3986 URI
* String : UTF-8 string, arbitrary length
* Bytes : Array of octets, arbitrary length
* List : List of objects
* Map : Mapping keyable objects to other objects
* Markup : Presentation data, similar to XML
* Reference : Points to previously defined objects or other documents
* Metadata : Data about data
* Comment : Arbitrary comments about anything, nesting supported
But the most important feature is that it is a paired format: a binary format [2] and a text format [3], which are 1:1 compatible. This allows you to transmit in the binary format, and only convert to text when a human is involved.
I've put together a quick comparison here: https://github.com/kstenerud/concise-encoding#comparison-to-other-formats https://github.com/kstenerud/concise-encoding#comparison-to-...
Currently, I'm finishing off the go implementation [4], which so far I've managed to get running 30% faster than the json codec, using less than half the memory. I'll be pushing the binary codec to master soon, and the text codec shouldn't take much longer since the code is pretty modular.
[1] https://github.com/kstenerud/concise-encoding#concise-encoding https://github.com/kstenerud/concise-encoding#concise-encodi...
[2] https://github.com/kstenerud/concise-encoding/blob/master/cbe-specification.md#concise-binary-encoding https://github.com/kstenerud/concise-encoding/blob/master/cb...
[3] https://github.com/kstenerud/concise-encoding/blob/master/cte-specification.md#concise-text-encoding https://github.com/kstenerud/concise-encoding/blob/master/ct...
[4] https://github.com/kstenerud/go-cbe/tree/new-implementation https://github.com/kstenerud/go-cbe/tree/new-implementation
- brokensegue 7y agoWhy add special support for URIs and not any other types that can be easily represented as strings e.g. UUID or ISBN
- kstenerud 7y agoIt's mostly a question of how common they are. Both uuid and ISBN can be represented as URI. However, I'm still on the fence regarding uuids, because they tend to get a lot of use in general... I may add it after all. The idea is to make a format for the 80% case, so things like ISBN are definitely out.
- brokensegue 7y agoExplicitly supporting Uri has a performance cost with no clear size win. Supporting UUID at least could win back some bytes.