3 ms·
The article mentions SAX parsers and then kinda just moves on and talks a bit about loading JSON with eval. I realize there are other ways of doing things and
by nirvdrum 15y ago
The article mentions SAX parsers and then kinda just moves on and talks a bit about loading JSON with eval. I realize there are other ways of doing things and a fair bit between his two data processing points. My experience with JSON is mostly limited to simple APIs.
Is there a way to handle streaming JSON? I guess it'd be doable in a language like JavaScript where you build up the prototype. Others would probably vary substantially. But I can't say I've tried it yet.
- zachanker 15y agoYes, there is support for stream parsing of JSON. I haven't tried it myself, https://github.com/lloyd/yajl https://github.com/lloyd/yajl is one example, which has various bindings in other languages.
- nirvdrum 15y agoAhh, silly me. I never realized YAJL handled that. It should be a good place to learn from. The YAJL code base is pretty tight IIRC.