-
Notifications
You must be signed in to change notification settings - Fork 4
/
741.txt
91 lines (60 loc) · 5.02 KB
/
741.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
[16]
[DFN[JSON5]] は、 [[JSON]] と似て非なる[[データ形式]]です。
その名前に反して、 [[JSON]] とは無関係に作られたものです。
* JSON5
[6]
[DFN[JSON5]]
は、
[[JSON]]
と
[[ES5]]
を参考に開発された[[データ形式]]です。
[[JSON]]
と称していますが
[[JSON]]
では'''ありません'''。
[17]
開発主体も [[JSON]] とも [[ECMAScript]] とも無関係です。
[5] [CITE[The JSON5 Data Interchange Format]], [TIME[2018-03-16T21:48:04.000Z]], [TIME[2021-02-19T12:33:40.006Z]] <https://spec.json5.org/>
[1] [CITE[aseemk/json5]]
( ([TIME[2014-03-05 02:33:30 +09:00]] 版))
<https://github.com/aseemk/json5>
[2] [CITE[JSON5 by aseemk]]
( ([TIME[2014-03-02 16:11:09 +09:00]] 版))
<http://json5.org/>
[FIG(quote)[
[FIGCAPTION[
[3] [CITE[JSON5 by aseemk]]
([TIME[2014-11-06 01:23:49 +09:00]] 版)
<http://json5.org/>
]FIGCAPTION]
> JSON5 is a proposed extension to JSON that aims to make it easier for humans to write and maintain by hand. It does this by adding some minimal syntax features directly from ECMAScript 5.
> JSON5 remains a strict subset of JavaScript, adds no new data types, and works with all existing JSON content.
> JSON5 is not an official successor to JSON, and JSON5 content may not work with existing JSON parsers. For this reason, JSON5 files use a new .json5 extension. (TODO: new MIME type needed too.)
]FIG]
[4] [CITE@en[GitHub - json5/json5: JSON5 — JSON for humans]], [TIME[2021-02-19T12:32:34.000Z]] <https://github.com/json5/json5>
[7] [CITE@en[GitHub - json5/json5-spec: The JSON5 Data Interchange Format]], [TIME[2021-02-19T12:35:09.000Z]] <https://github.com/json5/json5-spec>
[8] [[Web5]]とは無関係。
* JSON6
[9] [CITE@en[GitHub - d3x0r/JSON6: JSON for Humans (ES6)]], [TIME[2021-09-21T05:42:48.000Z]] <https://github.com/d3x0r/JSON6>
* ESON
[10] [CITE@en[GitHub - mmkal/eson: ESON — JSON for humans]], [TIME[2021-10-04T08:35:47.000Z]] <https://github.com/mmkal/eson>
>This is a backwards-compatible fork of https://github.com/json5/json5, with added support for template literals - based on the idea in this comment. Since JSON5 is a well-established and active project, most references to "JSON5" in this fork have not been replaced with "ESON", to avoid merge conflicts. When reading these docs and source code, you can mentally replace "JSON5" with "ESON" (or "json5" with "eson").
* SQLite 版 JSON5
[12] [CITE[JSON Functions And Operators]], [TIME[2023-06-23T13:20:40.000Z]], [TIME[2023-06-29T01:26:41.690Z]] <https://www.sqlite.org/json1.html#json5>
>Beginning in version 3.42.0 (2023-05-16), these routines will read and interpret input JSON text that includes JSON5 extensions. However, JSON text generated by these routines will always be strictly conforming to the canonical definition of JSON.
>[SNIP[]]For backwards compatibility, the json_valid(X) function continues to report false for inputs that are not canonical JSON, even if the input is JSON5 that the function is able to understand.[SNIP[]]
>
[SNIP[]]SQLite extends the JSON5 syntax in these two ways:
= Strict JSON5 requires that unquoted object keys must be ECMAScript 5.1 IdentifierNames. But large unicode tables and lots of code is required in order to determine whether or not a key is an ECMAScript 5.1 IdentifierName. For this reason, SQLite allows object keys to include any unicode characters greater than U+007f that are not whitespace characters. This relaxed definition of "identifier" greatly simplifies the implementation and allows the JSON parser to be smaller and run faster.
= JSON5 allows floating-point infinities to be expressed as "[CODE[Infinity]]", "[CODE[-Infinity]]", or "[CODE[+Infinity]]" in exactly that case - the initial "I" is capitalized and all other characters are lower case. SQLite also allows the abbreviation "Inf" to be used in place of "[CODE[Infinity]]" and it allows both keywords to appear in any combination of upper and lower case letters. Similarly, JSON5 allows "NaN" for not-a-number. SQLite extends this to also allow "QNaN" and "SNaN" in any combination of upper and lower case letters. Note that SQLite interprets NaN, QNaN, and SNaN as just an alternative spellings for "null". This extension has been added because (we are told) there exists a lot of JSON in the wild that includes these non-standard representations for infinity and not-a-number.
[13] 「[[JSON]]」と称して [[JSON5]] に対応する邪悪。これは本来の [CITE[[[JSON]]]]
仕様に違反している。
[CODE[json_valid]] がまともな挙動なのは最後の良心か。
[14] しかも「[[JSON]]」を称した「[[JSON5]]」がオリジナルの [[JSON5]]
ではなく独自拡張付きとかいう地獄。
[15] なぜ「違うものには違う名前をつける」という簡単なことができないのか。
* メモ
[11]
普及する前から [[fork]] が乱立とかやべーなwww
しかも [[fork]] が面倒だから(意訳)と本家の名前を名乗ってるとか闇すぎるwww