RCL's Design Dilemma: The Challenge of Floats
2025-03-04
The author faced a challenge while building the new configuration language RCL: how to handle floating-point numbers. As a superset of JSON, RCL needs to balance JSON semantics, the type system, and code readability. The article delves into the trade-offs between integer and floating-point types, such as whether to distinguish between integer and floating-point types, and how to handle numerical equality and type conversion. Ultimately, the author chose a single numeric type, "Number," to simplify language design and improve user experience. This solution is implemented in RCL 0.8.0.
Development
floating-point numbers