wampcc
wampcc copied to clipboard
consider nlohmann_json for next major release?
Hey, You might want to consider switching to nlarssson's json in a future release. It makes json a C++ datatype (e.g. you just use the usual container operations on the aggregate ones, etc), is faster than jansson (and written in C++11), supports msg pack natively, and is header-only. I just wrote a shim Lohmann_json <->jalson so our code could use json and then could just pass to to wampcc through a json-json translator. nlohmann is so c++-like it's worth doing this translation to get the benefit of wampcc.
I know this isn't a trivial code change but would result in smaller code. I haven't made a pull request for such a big change but might work on this if it's interesting to you.
Hello @dvhwgumby, I have wampcc integrated in two projects now and to avoid conversions between json types I have used wampcc::json_object everywhere. It is expected that many other project have done the same.
I would kindly ask if such a code change happens that it is switchable/optional during build time as it would completely break existing source codes linked to wampcc library.
Hi ... that would be a large change to the project, although possible to temporarily make it less disruptive by also keeping the wampcc::json_object as a wrapper. My original concern with nohlmann is that it might require later language features, so I though would be better to stick to roughly earlier modern-C++. I'll have a review. Although do note internally wampcc does use a separate C library for json, it is not an own implementation etc.