Comment

Comment by GeneThomas

> Consider the approach taken by XML 1.1

I evaluated xᴍʟ 1.0 and 1.1’s restrictions but consider the alternative, accepting anything but the empty string to be simpler.

>A lot of English-speaking countries actually have `.` and `,` swapped:

Which?

>...should state that encoders should pick a long enough decimal representation to avoid any such issue.

.net for example has round trip encoding to achieve this.

> Which base64 standard in [1]?

As linked in the document, we refer to ʀꜰᴄ 4648 for Base64 using the simplest version which states that “Implementations MUST include appropriate pad characters at the end of encoded data unless the specification referring to this document explicitly states otherwise”.

> I have outlined my rationale for layering in other comments.

>> Graph is generally a bad thing to encode at this level

The ᴅᴏꜱ attach you are concern about is not applicable. Layering graphs on top of the encoding in a separate standard is not practical. As stated serialization requires a graph structure.

>It is not too hard to define a data model in prose rather than code.

I have done that.

>May have been true in the past, but it's no longer true since SIMD-based parsers. Also the very existence of escape sequence prevents the true non-destructive zero-copy (aka in-situ) parsing anyway. With such sequences, zero-copy/in-situ parsing has to be destructive to be performant and that can preclude some use cases. Allowing additional space characters is much easier than that.

SMID based parsers would almost certainly run faster with simplified byte handling rules. Practically, when say skipping whitespace, searching for two specific bytes is faster than the alternatives. Most strings do not have escape sequences so do not need to be copied, a scan for '\' is fast.

> `<<Name>...<<$>`

This is to be terse. An array type in an xᴍʟ like language is a leap forward. Additional significant characters would over complicate the standard.

parent GeneThomas 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton