Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There is no reason you can’t do a SAX-style parser for JSON. A quick bit of searchengineering will find dozens, eg. https://github.com/dgraham/json-stream


You can in principle, but because the order is not guaranteed, you may find yourself accumulating things in memory. It depends on the task of course, but neither standard parsers nor generators are required to send adjacent JSON entities in a specific order.

I remember someone describing a trick where instead of sending a JSON array they'd just send a stream of JOSN objects, one per line, so that the receiving end could parse the data in a streaming fashion. But that's not JSON anymore.


JSONlines is a relatively common technique http://jsonlines.org/


Almost sounds like JSON is the new "we use CSV, but..."




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

Search: