gritzko / ron

(dated, see the site) Replicated Object Notation, a distributed live data format, golang/ragel lib
http://replicated.cc
Apache License 2.0
360 stars 7 forks source link

JSON-to-RON encoding #28

Open cblp opened 6 years ago

cblp commented 6 years ago

I know, JSON is here just for an illustration, but this is inconsistent.

There are 2 JSON example in the Spec.

Example 1.

*lww #1TUAQ+gritzko @`   :bar = 1
     #(R            @`   :foo > (Q

Problems

  1. The Spec says header is mandatory. If these are raw ops, then semicolons must present. If reduced, then a header must present.

  2. From example 2 one may conclude that you must create and empty dictionary before filling its fields. There is no empty object op here.

Example 2.

*lww #1D4ICC+XU5eRJ @1D4ICCE+XU5eRJ :0       !
*lww #1D4ICC+XU5eRJ @1D4ICCE+XU5eRJ :keyA    'valueA'
*lww #1D4ICC+XU5eRJ @1D4ICC1+XU5eRJ :keyB    'valueB'

Problem

How can a reader know this object is a dictionary (JSON object)? Just because the fields are filled with values? What about an empty dictionary? Does its encoding differ from null?

Just question: what is the purpose of the header? Declaration of the object? Must it be the root op?

cblp commented 6 years ago

@gritzko: header содержит метаданные редукции которые могут быть нужны при следующей редукции