Dev builds zero-dependency JSON parser in Rust, exposes stdlib validator gaps
A developer spent a weekend building a fully RFC 8259-compliant JSON toolkit in Rust called jaq-lite, using absolutely no third-party libraries. The project revealed that roughly 10% of JSON values the spec requires parsers to reject — including NaN, Infinity, and leading zeros — are silently accepted by Rust's standard f64 and i64 parsers. Testing against the JSONTestSuite conformance corpus confirmed 19 of 47 invalid number cases passed through Rust's built-in parsers without error. Similar non-conformance was found in Python's json module, which accepts NaN and Infinity by default, and in JavaScript's Number() function, which accepts hex, octal, and binary literals. The findings highlight that standard library parsers are general-purpose tools, not JSON validators, and developers should not rely on them for strict format compliance.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in