3 ms·
In the real world, I would think all JSON would be produced by code (there are easier to read/write formats for human generated data, like YAML or key=value or
by SwellJoe 18y ago
In the real world, I would think all JSON would be produced by code (there are easier to read/write formats for human generated data, like YAML or key=value or INI style config files, for which there are numerous parsers in every language I can think of).
Perl has JSON::XS (my favorite) and the compatible pure-Perl JSON::PP, as well a few other options of varying degrees of quality and performance.
use JSON::XS;
my $json_reply = JSON::XS->new;
print $json_reply->encode(["Hello", "World", [123, 321]]);
We use map and grep extensively to produce the JSON to build our GUI elements, and it works like magic. I'm sure Ruby and PHP have similar libraries.