Re: [dev] Re: json

From: Mattias Andrée <maandree_AT_kth.se>
Date: Sat, 15 Jun 2019 21:28:05 +0200

`long double` is able to exactly represent all values exactly
representable in `uint64_t`, `int64_t` and `double` (big float
can be used for other languages). Wouldn't it just complicate
matters if you needed to specify whether a number is an integer
or a real value; if there is any need for it, the software can
just check which it best fits. Additionally, I think you would
want to support for arbitrary precision. Again, the software
can just check if arbitrary precision is required, no need to
complicate the syntax. What should a library do with parsed
numbers that are too large or too precise? In most cases, the
program know what size and precision is required.


Regards,
Mattias Andrée

On Sat, 15 Jun 2019 20:37:34 +0200
Wolf <wolf_AT_wolfsden.cz> wrote:

> On , sylvain.bertrand_AT_gmail.com wrote:
> > json almost deserves a promotion to suckless format.
>
> Except for not putting any limits on sizes of integers. I think it would
> be better to have size the implementation must support to be json
> complient. And also having separate int and float types. Because let's compare
> what happens in ruby:
>
> JSON.parse(?9 * 100))
> => 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
>
> and in firefox (JavaScript):
>
> var x = ''; for (var i = 0; i < 100; ++i) { x += '9'; }; JSON.parse(x);
> => 1e+100
>
> So, yeeeey interoperability I guess?
>
> W.
Received on Sat Jun 15 2019 - 21:28:05 CEST

This archive was generated by hypermail 2.3.0 : Sat Jun 15 2019 - 21:36:08 CEST