kdl-org / kdl

the kdl document language specifications
https://kdl.dev
Other
1.1k stars 61 forks source link

KDL Schema: clarify definition of "format" #235

Open nichtich opened 2 years ago

nichtich commented 2 years ago

KDL Schema Specification includes format for string and number validation to control the "Intended data format" but KDL does not know the concept of data formats. What should a validator check with format?

swift2plunder commented 2 years ago

While internal representation is likely out of scope and probably should remain so, the same can't be said of the effects. Underflow in single precision floats was recently cited as argument that KDL would be better with a stronger opinion on numeric formats

The argument is that there exists a number, N, that can be safely represented in a 32 bit float, for which there is a value N+1 that could be correctly parsed and stored as a 64 bit float, but would render as N if stored as a 32 bit float. As long as we're talking about a tractable number of such cases, like overflow and underflow errors possible with the formats listed in the schema document, I'm prepared to identify N and write test cases for attempting to roundtrip N+1, though I'll have some questions in the process