You can try it here: https://github.com/planetis-m/jsonx
Replaced std/streams with compiler/llstreams so that reading from and writing to files is still supported.
Why do the compiler's streams work better than the stdlib's?
If these also affect the stdlib’s parser, please port them back.
I’ll try. It mostly comes down to how trailing , is handled in arrays and objects, e.g. {"a": 1,} and [1,].
I ended up reverting most of cblake’s changes because float parsing was approximate. Number parsing now relies on what the stdlib does, which is quite permissive. However, I kept the logic that avoids using my.a for numbers and instead parses directly from the buffer into i: BiggestInt or f: float; this could also be ported.
Why do the compiler’s streams work better than the stdlib’s?
It’s the usual issue of dynamic dispatch versus static dispatch. I admit I didn’t benchmark this before making the change.