Earlier quoted context omitted.
If you wanted JSON to parse into actual date objects, you could always do: { thisIsADate: new Date('1995-12-17T03:24:00Z') } It would be simple enough for parsers in other languages to parse this into their own date objects. Much simpler than using regexs to find ISO strings.
I think allowing a whitelisted set of constructors (so it's extensible, but with some standard ones) as types in a future JSON-like could be good. e.g. { birthdayParty: Date(1632817436514), sounds: Map([["cow", "moo"], ["fox", "?"]]), possibilities: Set(["she loves me", "she loves me not"]), aSymbol: Symbol("tag"), aBuffer: UInt8Array(ArrayBuffer([104, 101, 108, 108, 111])), } So you'd do something like const seriali…
I think all JSON needs in this regard is type hinting. Let everything else be handled by the application:
{
birthdayParty: Date 1632817436514,
sounds: String? { // zomgwtfbbq comments too
cow:"moo",
fox: null
},
possibilities: ["she loves me", "she loves me not", 42],
aSymbol: Symbol "tag",
aBuffer: Uint8 [104, 101, 108, 108, 111]
}