tvix: warn when floats are converted to string (or json or toml)

#367
Opened by flokli at 2024-01-12T10·32+00

Rendering floats to strings (decimal representation) is a bit fuzzy.

Some floats are be periodic (in their decimal or binary representation), and there is a loss of precision. There might also be some corner cases with math, where different architectures might produce different results.

This is very terrible in places where we rely on reproducible output, such as hashing functions.

More context:

We should discourage float usage in Tvix.

There should be a way (feature flag/runtime config) to entirely disallow it. In case it is used, we should probably warn where it's used.

  1. flokli updated the body of this issue at 2024-01-12T10·35+00