Hacker News new | past | comments | ask | show | jobs | submit login

Wait. How is this no longer a minefield just because there is a test suite that identifies some tricky cases?

Doesn’t the test suite’s matrix demonstrate that there are tons of cases that aren’t handled consistently across these parsers?




Good point. I am presuming the test suite is comprehensive. Does it cover 100% of all JSON mines? Probably not. But it surfaced about 30 bugs in my own implementation - things I would have never dreamed of.

So it certainly helped me. And just based on how thorough and insane the test suite is, I think I'm in good hands. Not perfect hands - but definitely a million times better than anything I would have come up with on my own.

The test suite made my parser blow up many times, and for each blow up I got to make a conscious decision in my bugfix: how do I want to handle this?

(I decided to let the 10,000 depth nested {{{{{{{{{{{{{{{{{{"key","value"}}}}}}}}}}}}}}}}}}} guy blow up even though it is legal. Yes, I'm too lazy to implement my own stack.) :-)


It's a very clear list of mistakes to avoid and areas where you can choose to be lenient in parsing.

If you're emitting JSON you can skim the list and avoid all of them.

Either way the minefield proper is no longer your problem.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: