[Haskell-cafe] Is it possible to have constant-space JSON decoding?

Herbert Valerio Riedel hvr at gnu.org
Tue Dec 4 16:15:22 CET 2012


Clark Gaebel <cgaebel at uwaterloo.ca> writes:

[...]

> I didn't even know people used JSON to store millions of integers. It
> sounds like fun.

Actually, JSON is quite convenient if you need a standardized common
interchange format between Python, Ruby, JS et al. based components as
it directly maps to a common subset of primitive data-structure
available in those languages (i.e. bool,strings,numbers,arrays,objects)
and also very efficient JSON decoders are available by now (maybe even
part of the respective standard library)

So I'm actually struggling myself to find a way to get large JSON text
parsed in Haskell with a comparable memory footprint to e.g. Python.

As for generating large JSON document, I've found in 'json-builder' a
more memory efficient alternative to 'aeson'.



More information about the Haskell-Cafe mailing list