Re: [boost] Official JSON Package

Is there an official Boost package for reading and writing JSON data?
Not on Boost, I would suggest you the RapidJSON. Do not use boost PropertyTree since you will face incompatibilities mainly with arrays.
Given that JSON is a de-facto standard (along the lines of INI files and the like) would an official addition as a boost library be considered?

On Fri, May 1, 2015 at 3:25 AM, Michael Ainsworth
Is there an official Boost package for reading and writing JSON data?
Not on Boost, I would suggest you the RapidJSON. Do not use boost PropertyTree since you will face incompatibilities mainly with arrays.
Given that JSON is a de-facto standard (along the lines of INI files and the like) would an official addition as a boost library be considered?
I'd certainly love to see one. -- Olaf

On 1 May 2015 09:37, "Michael Ainsworth"
Is there an official Boost package for reading and writing JSON data?
Not on Boost, I would suggest you the RapidJSON. Do not use boost PropertyTree since you will face incompatibilities
with arrays.
Given that JSON is a de-facto standard (along the lines of INI files and
mainly the like) would an official addition as a boost library be considered? I'd love to see one too. However, it simply may be tricky to beat performance of rapidjson https://github.com/miloyip/nativejson-benchmark Anything slower would not be appreciated, nobody would use it. Mateusz Łoskot, http://mateusz.loskot.net (Sent from mobile)

On 05/01/2015 03:25 AM, Michael Ainsworth wrote:
Given that JSON is a de-facto standard (along the lines of INI files and the like) would an official addition as a boost library be considered?
There was a JSON project proposed for GSoC 2013, but it did not get enough votes to be selected (it was the highest voted project just outside the selected list.) You can find a Boost-compatible JSON parser at: http://protoc.sourceforge.net/ It comes with Boost.Serialization integration, so you can parse your JSON files directly into the appropriate data structures. It is also possible to use dynamic::var [1] as a DOM. [1] https://code.google.com/p/dynamic-cpp/

Hi, I've been using the cppcms json api which is pretty well done. And the jsoncpp libraries also, which was pretty ok but I found the API more oldschool and less flexible. It's the json parser used in chrome I believe. And for the freelan vpn project we have a library named : kfather. Which is a json parser/serializer on top of boost variants. This makes it nice to visit json with the visitor pattern. Additionally there are new json libraries which uses brace initialization making json feel really natural inside C++: https://github.com/nlohmann/json. It's the same in java there are many libraries, with each their advantages and disadvantages, but it would be great if some would make the effort to bring a Boost.Json which would bring all the good points together. Cheers, -- Damien Buhl

In my opnion, I do not see the need for a complete new JSON boost library.
The Boost PropertyTree is great and it is more than 90% done. If the
serialization to JSON worked as it should and could take care properly of
arrays and strings properties it would be a great JSON parser with the
advantage to use exact the same coding that a lot of people are already
using to parse XML.
Am I being too optimistic about the PropertyTree project or there are any
characteristic special to JSON that could not be handled with PropertyTree
that I am not seeing here?
On Fri, May 1, 2015 at 7:07 AM Damien Buhl
Hi,
I've been using the cppcms json api which is pretty well done. And the jsoncpp libraries also, which was pretty ok but I found the API more oldschool and less flexible.
It's the json parser used in chrome I believe. And for the freelan vpn project we have a library named : kfather. Which is a json parser/serializer on top of boost variants. This makes it nice to visit json with the visitor pattern.
Additionally there are new json libraries which uses brace initialization making json feel really natural inside C++: https://github.com/nlohmann/json.
It's the same in java there are many libraries, with each their advantages and disadvantages, but it would be great if some would make the effort to bring a Boost.Json which would bring all the good points together.
Cheers, -- Damien Buhl
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

On 05/01/2015 04:28 PM, Rogerio dos Santos wrote:
Am I being too optimistic about the PropertyTree project or there are any
The problem with Boost.PropertyTree is that it is a DOM, so it only carters for some use cases. For instance, if JSON is used as the encoding for wire protocols, then you want to parse the JSON directly into associated data structures, without having to go through an intermediate DOM. If you do need a DOM, then Boost.PropertyTree is just fine. It could even leverage a (still-hypothetical) Boost.Json parser.

If you do need a DOM, then Boost.PropertyTree is just fine. It could even leverage a (still-hypothetical) Boost.Json parser.
Yes but wouldn't it be nice if Boost has support for various file formats (e.g. xml, json)? Boost property tree and serialization can user these libraries as many other clients. Ofc this would start the whole modularization discussion again.

Damien Buhl wrote:
Additionally there are new json libraries which uses brace initialization making json feel really natural inside C++: https://github.com/nlohmann/json.
That's pretty nifty.
participants (8)
-
Bjorn Reese
-
Damien Buhl
-
gast128
-
Mateusz Loskot
-
Michael Ainsworth
-
Olaf van der Spek
-
Peter Dimov
-
Rogerio dos Santos