On Do, 11.11.21 19:02, Florian Weimer (fweimer@xxxxxxxxxx) wrote: > * Lennart Poettering: > > > And I think that's a *good* thing: JSON might not be perfect — because > > nothing is —, but it's certainly one of the better designed generic > > data formats around, and it's complexity is absolutely managable. > > Number handling in JSON is underspecified, and some variants (including > the original one) are not exactly easy to implement. I assume you > simply don't use numbers in the data? We indeed do not. But I think the reality of JSON numbers is not as bad as it's sometimes painted. I recently checked various implementations precisely for this and all of the implementations I checked supported at least int64_t and 64bit ieee float as internal storage types, many also uint64_t, and some even arbitrary length numerics (python, specifically). So I think effectively one can reasonably rely on the fully mapped integer range of INT64_MIN…INT64_MAX as well as the full 64bit ieee float range (though no -inf, +inf, nan, since JSON has no way to encode that) to be losslessly reproducible. And with minor restrictions on the set of supported JSON parsers INT64_MIN…UINT64_MAX might be OK too. I think specs that use JSON should probably declare the expections they make on the JSON implementations, i.e. which integer and float range they expect that the parsers can reproduce losslessly. Given that our ELF spec currently doesn't use any numbers it's not much of an issue right now, but maybe indeed we already should clarify this already in the beginning, in case people eventually want to extend their snippets with numbers one day. Posted a PR for that: https://github.com/systemd/systemd/pull/21319 Lennart -- Lennart Poettering, Berlin _______________________________________________ devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure