Show HN: LCON – Ludicrously Compact Object Notation
github.com
github.com
2. There's no emitter, just a parser. This suggests to me that there's no such thing as a canonical LCON transformation for a given input. This is bad.
- Easy chaining of one-element maps. `a b c d` = `{a: {b: {c: d}}}}`
- Only a few reserved characters, so just about anything can be an unquoted string (symbols, etc.)
- Parenthesized maps
2. This is the first version. An emitter will probably be in the next version. The canonical version is essentially "JSON, but with unquoted strings where possible, no colons, and parens instead of braces".
This seems less obvious (or slower to digest) but I've stared at yaml and markdown for a while now.
I'll stick with JSON.
...comes in handy for those occasions when the courts order you to hand over some data - especially effective when printed.
[
{
"a": "b",
"c": "d"
},
{
"e": "f",
"g": "h"
},
]
In YAML also trivial and very concise: - a: b
c: d
- e: f
g: h
But in CSON (if I remember correctly), I think this looks odd and confusing by comparison: [
a: "b"
c: "d"
, # <- note dedent, without this it comes out as one object not two
e: "f"
g: "h"
]
Now, in each of these you can just revert back to JSON for the difficult part, but that kind of defeats the purpose. I think YAML-the-syntax strikes a really nice balance between eliminating unnecessary punctuation and having solid structure, and LCON seems like it does as well. CSON errs too far on removing punctuation without a lot of thought put into the remaining structure.If I understand correctly, the above example in LCON would be (at most minimal):
. a b
c d
. e f
g h
I actually really dislike this use of . and would like to know a rationale for it, to be honest.As for the ., I chose it over - or * for the bullet character because I designed LCON as the syntax for a JSON-Lisp programming language, and - or * could conceivably be used as prefix operators for math functions (* [5, 6]), leaving . as the only "bullet-like" ASCII character left.
The more I write LCON, the more I realize that the . can be difficult to see (though it's still not as bad as CSON's dedented commas...), so I can see your point, I'm just not sure what other character to use. In an earlier version, I had used :: as a bullet, but that ended up looking ugly.
But I don't know anything about this other project of yours other than what you've said here.