mortie / jcof

An efficient drop-in replacement for JSON.
ISC License
153 stars 0 forks source link

discussion: why not just JSON with some conventions ? #8

Open setop opened 2 years ago

setop commented 2 years ago

The rational of JSON is to propose a trade off between human readable (view and modify in a text editor) and machine processable (easy parser, basic typing, reasonably fast).

JCOF makes a very small progress to the right (more clever encoding) but a huge regression on the left (unreadable).

Here the use case seems very tabular data oriented. There are text format like TSV/CSV for that.

If the point is to reduce the overhead of JSON when encoding tabular data, it can be done as below:

{ "peoples" :
{ "_headers"  : ["age","first-name","full-time","occupation"],
"_records" : [
,[32,"Bob",true,"Plumber"]
,[28,"Alice",true,"Programmer"]
,[36,"Bernard",null,null]
,[57,"El",false,"Programmer"]
]}}

Thanks for the experimentation, data encoding is always interesting