Live data from Hacker News

New better alterative to XML, JSON and YAML

xenondata.org

121–130 of 148 posts

Re: New better alterative to XML, JSON and YAML

#121

Earlier quoted context omitted.

"May", not "should", so some data don't have a graph structure. It really boils down to the ratio between non-graph data and graph data. I have some reason to believe that the former far outnumbers the latter, but maybe you have some concrete evidences against?

You misunderstand. Given that data MAY be a graph structure, the markup MUST support that. A tree with pointers to the parent nodes has a graph structure, a common enough occurrence.

Data MAY also include Egyptian hieroglyphs not encoded in Unicode. Does it mean that the markup MUST support them as well? I bet not. No format can natively support every possible data structure; serialization formats only have to support enough of them to which remaining structures can be isomorphically mapped.

> a common enough occurrence

Do you have a concrete figure about "common enough"? Otherwise we are only talking through anecdotal evidences (not necessarily bad though!). At least in my experience, graph structures do occur from time to time but almost all of them can be easily rewritten to non-graph form because they are typically DAGs and obviously ranked (i.e. its preferred topological order forms partitions of different nodes). The general graph that requires something like references was very rare.

Re: New better alterative to XML, JSON and YAML

#123

Earlier quoted context omitted.

Here the canonical representation refers to one single definite and unambiguous encoding for given data. This requirement is very common in cryptographic applications and also commonly demanded when the deterministic processing is desired. Technically the "canonical" and "deterministic" encoding can differ (e.g. ASN.1 CER vs. DER), but there is not much value to have two distinct encodings. On graphs: as you've said…

Is canonilization not irrelevant. Any format with comments is not canonical; so xᴍʟ is not, ᴊꜱᴏɴ has escapes options for string characters so it not either. Response to graph conjecture stated https://news.ycombinator.com/item?id=42072133 .

Almost no serialization format is canonical by default---AFAIK bencode was the sole example that mandates the canonicalization. Instead, a canonical subset of the format is usually defined, which would of course exclude comments, unless comments themselves are considered semantic like XML. Yes, even XML has a canonical subset [1]!

[1] https://www.w3.org/TR/xml-c14n/

Re: New better alterative to XML, JSON and YAML

#124

Earlier quoted context omitted.

> Readability. Okay, I see you demand a very explicit question: why did you use comma instead of other characters for grouping? > [separate standards documents] do you think that's also a no-go? Yes. I like to hear why then, given this approach seems to be very successful for Unicode and many others. > Data model here: Thank you for the grammar. The document will massively benefit from such explicit description, I co…

> why did you use comma instead of other characters for grouping? Because English is the global lingua franca > I like to hear why then Unlike Unicode xᴇɴᴏɴ must be defined in one grammar. Having special names, like $type, and hoping no language uses them is fragile.

> Because English is the global lingua franca

But English is not the largest language in terms of the number of speakers. I speak Korean for example and three-digit grouping is unnatural in Korean, which uses myriads instead. I guess Xenon is designed to be not comfortable for the vast majority of people including me then?

> Having special names, like $type, and hoping no language uses them is fragile.

I was not proposing special names after all. Xenon clearly has a much better extension point, namely the type string. You can have just one reserved character, which is very unlikely to appear in verbatim, and use it for the extension. And it is even unclear whether JSON's use of `$` for such special names was fragile after all, given that such complaint seems uncommon. (I complained about that in the past, but I mean others seemed to be cool.)

In addition, I don't think you have mapped enough languages to conclude so anyway. For example, can you list all popular enough languages that allow `$` in identifiers? While whether to allow `$` or not requires a single example, maybe you have missed other identifiers in other languages! (Angle brackets are also common in stringified types, after all.) So I expected you to have at least looked at them for your conclusion.

Re: New better alterative to XML, JSON and YAML

#125

Earlier quoted context omitted.

There exists a charset that is more efficient than UTF-8.

I am futureproofing.

> There exists a charset that is more efficient than UTF-8.

> I am futureproofing.

Which is true: such charset does exist today, or you merely have prepared for that in the future?

Re: New better alterative to XML, JSON and YAML

#126

"Documents must be utf-8 and should have a byte order mark." No. If you're using UTF-8 (which is a good choice), the use of a BOM should be discouraged. Given that the format specification says documents MUST be UTF-8, there is no need to enable detection of UTF-8 content with the UTF-8 BOM. And, of course, the original purpose of the BOM (detecting big- or little-endian encoding) is unnecessary in UTF-8. The Unicode…

There exists a charset that is more efficient than UTF-8.

Which is…?

Re: New better alterative to XML, JSON and YAML

#127

Earlier quoted context omitted.

There is a widespread agreement that XML is generally bad for the data serialization, while HTML is not much questioned as such. You can't carelessly adopt angle brackets without why such difference exists in the first place [1]. [1] Hint: "semi-structured data"

You mean ʜᴛᴍʟ is not used a such.

If you figured that out yourself, you should have also realized that angle brackets are generally considered bad for the data serialization. Cherry-picking my words without answering my whole point is not a good move.

Re: New better alterative to XML, JSON and YAML

#128

Earlier quoted context omitted.

> When serialising data with ᴊꜱᴏɴ one has to use special field names such as $id; hoping the programming language does not. Unless a serialization/deserialization tool supports property name overriding which is trivial. > It DOES have native graph support that xᴍʟ and ᴊꜱᴏɴ do not. Again, how is this different from `xml:id` that is referenced from other XML document nodes and what makes it "native graph support"? > Bo…

> Again, how is this different from `xml:id` It is a tidier solution. > I still can't get what makes timestamps (and GUIDs) so special so that they have special sections in your document. They are common in data. > [...] boolean attributes Separate attributes and sub elements is a mistake. One should be able to guess an ᴀᴘɪ. > What more scalar types it can be extended with? > letting the application make decision how…

> It is a tidier solution.

Based on special syntax. You're about to introduce node attributes.

> They are common in data.

I use tables everyday. May I have "first-class graph support" but for tabular data that is very common as well? I expected three or four times you eventually explain what makes the graph support and how it differs from declaring ids and refs in other formats you think are worse than yours. No answer.

> Separate attributes and sub elements is a mistake. One should be able to guess an ᴀᴘɪ.

For the first, I kind of agree that attributes and subnodes should be unified in favor of subnodes (which was sacrificed for markups like HTML for sane brevity sake). However attributes, your ids are, may be metadata for nodes of any kind. For the second, API for what? Document generating/parsing API? Validation API? Serialization/deserialization API? Enveloped application API? I guess, the latter for whatever reason dictated in your "standard" . In any case documentation, schemas, data validators and autocompletes are my best friends, no need to "guess".

> That is laborours! A Xᴇɴᴏɴ library provides AsGuid, AsDateTime etc.. and serialization directly to/from those types.

What you're mentioning is called serialization and deserialization, and these two be easily implemented once for "basic" types and extended at the application level for any kind of data, because an application decides what to do with data on its own, not the format the data is enveloped in. Serialization and deserialization don't exist from the format perspective which only defines the syntax way data is marked up in a document. So why would it care the formatting at all?

> Yes. Human have to read markup.

Format should not care too much.

> I repeat! READABILITY.

No yelling please. Regional formats are defined by countries, not languages you said elsewhere, just by definition, even if English is the lingua franca. Separate digits with underscores or spaces.

I'm very happy your "standard" neither recommend color highlighting for, say, numbers, nor even worse has special syntax for readability highlighting. Highlighting increases readability greatly as well, you know.

> No, quite the opposite.

6:4 but 1:3 is a great syntax win. Okay.

No any solid counter arguments from your side being blind for obvious design flaws of your so-called format "standard" only tells how you mixed up all concepts in a mess of crazy syntax markup, and scalar object formatting for scalars that only must be handled by applications while serialization and deserialization regardless the markup format "standard" recommends.

Good luck with your "standard" rightly criticized and rejected by others, but better just bury it not spending your life for nothing. Sincerely.

Re: New better alterative to XML, JSON and YAML

#129
post #46

Earlier quoted context omitted.

The main advantages of XML (or any standard) is adoption and a wide ecosystem. Unfortunately that beats any "better" standards by a wide margin. One thing that is also really important is the ability to define a schema and be able to validate. See XML Schema, JSON Schema. This is a really tricky problem to get right. Especially if you try to do both with the same model (describing your data model and describing how i…

I conject that with programming languages that do not crash schemas used for validation are relatively unimportant. xᴍʟ schemas suffer from the fact that one can not specify that an element may only appear once.

In fact, the purpose of the maxOccurs indicator in xsd is to specify that an xml element may only appear once.
Post reply on HN