Lucian Marin

JSON without curly braces

I find creating and reading JSON files insanely hard and complex. This is why I want to create a format that’s simple to understand, manage and write by humans. It’s backward compatible with JSON. As you can see I was inspired by Sass and Python. You can call this object notation format: LMON (light machine object notation), PYON, JSON lite or you can come up with a better name.

Here’s my definition of the format:

LMON is indented and has a single notation “:”. When “:” is used it can declare an array or an string. When “:” isn’t used it creates an object. An empty object can be considered a property. Strings (or keys) can be numbers, strings, true, false or null.

Is that simple enough? I think it is. Below are some examples about how it works.

Simple object

object
    string1: 1337
    string2: “string”

Simple array with two objects

array:
    object
        string: “value”
        string: False
    object
        string: “value”
        string: True

An array containing an object having an array and a string

array:
    object
        array:
            object
                string: value
        string: value
    object
        string: value

An empty object can also be a property

array:
    string: value
    property1
    property2

I don’t yet have an implementation of this, but if you have time to write a conversion between LMON and JSON, let me know. I know about YAML, but I find it too complex and it can’t be used rapidly in development.

The YAML spec states this:

1.3 Relation to JSON (…) It may be useful to define a intermediate format between YAML and JSON. Such a format would be trivial to parse (but not very human readable), like JSON. At the same time, it would allow for serializing arbitrary native data structures, like YAML. Such a format might also serve as YAML’s “canonical format”. Defining such a “YSON” format (YSON is a Serialized Object Notation) can be done either by enhancing the JSON specification or by restricting the YAML specification. Such a definition is beyond the scope of this specification.

This “YSON” is actually quite simple to define, as you can see above.