Am 28.02.2019 um 19:03 schrieb Allin Cottrell:
On Thu, 28 Feb 2019, Sven Schreiber wrote:
> I'm still talking about stuff I don't fully understand,
but maybe we
> should have a hansl function that writes out the contents of a bundle
> (or let's say, a well-defined subset of possible contents) as a json
> string or file.
bwrite() already serializes a bundle as XML. Is there a substantial
advantage in having a JSON serialization too? If so, is that best done
by writing a new serialization, or by transcoding the XML? (Googling
"convert XML to JSON" shows up tons of transcoding options.)
Artur can perhaps give a better answer, but my impression with xml is
that it is too generic. You can do a lot of stuff with it, but in the
end that requires to have some clever xslt or similar thing which for me
basically means the same amount of work as simply exporting it in the
desired format in the first place.
So what's the use of a gretl bundle written out in xml from, say,
Python's point of view? Well, given the nice xml tools for Python I can
imagine it's not too difficult to get a tailor-made solution to grab the
matrices in there. So yes, maybe the json thing isn't needed. For target
languages without such tools my first impression is that reading and
processing json is simpler.
FWIW,
sven