But how does JSON fare when coupled with Ada?
Pretty good actually. I ventured into the realm of JSON suspecting I would end up having to write my own parser/generator, but as luck would have it, one of my favorite Ada libraries, GNATColl, turned out to have support for JSON in its latest SVN checkout, and even better: It was pretty good!
I started mucking about with the GNATColl.JSON package, and after an initial failure to make it work (due to me not being able to read properly), I made it fly. And it flew well. It is both intuitive to use, and very clean to read. There’s really nothing bad to say about the JSON support in GNATColl, except for perhaps one little thing: It’s still very new, so new in fact that at the time of writing, there’s no entry for it in the GNATColl manual. This is not a huge issue, but it’s worth taking into consideration.
To really drive home the fact that I enjoyed working with the GNATCOLL.JSON package, I wrote a couple of articles and dropped some test code at my GitHub page:
In short: JSON and Ada programming is a good match, so before settling on using XML for your data-interchange needs, perhaps it’s worth taking a look at JSON? It is much nimbler and very easy to work with.