3 ms·
> Go can decode numbers losslessly as strings: https://pkg.go.dev/encoding/json#Number https://pkg.go.dev/encoding/json#Number Yup, and if you’re using JSON in
by eadmund 1y ago
> Go can decode numbers losslessly as strings: https://pkg.go.dev/encoding/json#Number https://pkg.go.dev/encoding/json#Number
Yup, and if you’re using JSON in Go you really do need to be using Number exclusively. Anything else will lead to pain.
> I'm half joking, but I'm not sure why S-expressions would be better here. There are LISPs that don't do arbitrary precision math.
Sure, but I’m referring specifically to https://www.ietf.org/archive/id/draft-rivest-sexp-13.html https://www.ietf.org/archive/id/draft-rivest-sexp-13.html, which only has lists and bytes, and so number are always just strings and it’s up to the program to interpret them.