> It raises TypeError on an unsupported type or a number that is too large.
Why does it raise an error on "a number that is too large"? The JSON spec does not put any limit on the size of numbers. Practically speaking, integers that don't fit in 53 bits won't be preserved when decoded by JavaScript and some other libraries, and integers that don't fit in 64 bits will likely not be preserved by most libraries, but as far as the JSON spec is concerned you can have integers of any size (or floating-point numbers of any precision).
This is the kind of thing that Rust can do so well -- export high performance, safe and trustworthy functionality to any language that can bind with native code.
C/C++ does everything but the safe and trustworthy part.
Why does it raise an error on "a number that is too large"? The JSON spec does not put any limit on the size of numbers. Practically speaking, integers that don't fit in 53 bits won't be preserved when decoded by JavaScript and some other libraries, and integers that don't fit in 64 bits will likely not be preserved by most libraries, but as far as the JSON spec is concerned you can have integers of any size (or floating-point numbers of any precision).