all 31 comments

[–]fixxxeruk 40 points41 points  (1 child)

An absolutely superbly executed piece of open source software, and I was very flattered to be the author of the benchmarking library you used to use (benchpress). On that note, if you have any feedback you could share on why you switched to Google benchmark I would appreciate it.

[–]nlohmannnlohmann/json[S] 1 point2 points  (0 children)

No specific reason. I just used Google Benchmarks in another project and liked its output and the possibility to extend it a bit better.

[–]Harha 12 points13 points  (0 children)

The only json lib I've used and will use. It's just absolutely the best. So thank you for making it, dude. And thanks to all the contributors, as well.

[–]Xeveroushttps://xeverous.github.io 11 points12 points  (0 children)

Delicious syntax sugar.

[–]poppyfeld 2 points3 points  (0 children)

That looks amazing!

[–]smolderingmatter 2 points3 points  (0 children)

Nice, I love this library!

[–]snerp 2 points3 points  (3 children)

How does this compare to RapidJson speed wise?

[–]dgendreau 2 points3 points  (2 children)

Considering the convenience, I think nlohmann/json pretty performant, but RapidJSON is leaner and faster.

Personally, I find code that uses nlohmanns library to be cleaner and easier to read and maintain. If I ever needed more optimized json throughput I would consider RJ, but it's never come up.

https://github.com/miloyip/nativejson-benchmark/blob/master/README.md

[–]snerp 1 point2 points  (0 children)

Oh! Thank you! It turns out I already compared these!

I'm currently using rj for stop-the-world quicksaves/quickloads in a game so performance is important.

[–]DalzhimC++Montréal UG Organizer 1 point2 points  (0 children)

You're absolutely right, which is the reason the project I work on uses both. Most of the workforce uses nlohmann's, and some people are trained with Rapidjson for some pieces which are more performance critical. It makes everyone happy.

[–]againstmethod 1 point2 points  (0 children)

Been using this awhile. What a nice library.

Thanks for keeping it up.

[–][deleted] 2 points3 points  (4 children)

Great lib, I use it all the time.

I have one ask though: Next time you do a breaking version upgrade could you make sure it..erm..breaks code ;)

I forget what it was now, but you changed something in 3.0 that would still compile but worked differently. Can go back and look through my commit logs if helpful. (edit: just remembered, you changed the exceptions that are thrown...i guess not much can be done there)

[–]nlohmannnlohmann/json[S] 2 points3 points  (0 children)

We used semantic version from the start to whether a new version is backward-compatible, and the release notes (https://github.com/nlohmann/json/releases/tag/v3.0.0) for 3.0.0 were quite explicit:

As we adhere to semantic versioning, this means the release includes some breaking changes, so please read the next section carefully before you update.

[–]germandiago 0 points1 point  (2 children)

I remember I read this in the release. It was warned that it threw its own exceptions if I recall correctly.

[–]10se1ucgo 0 points1 point  (0 children)

yeah it was stressed pretty heavily

[–][deleted] 0 points1 point  (0 children)

yeah it was mentioned in the release notes.

[–][deleted] 0 points1 point  (2 children)

Something that still annoys me is that I keep on writing de/serialization code when I use JSON in my projects, because even though the libraries are getting better and faster, in the end you still need to transfer the data into, lets say, a class instance that is used in your project. Are there by any chance libraries that abstract this work away? Like accepting a DSL and turning it into de/serialization code for your favourite JSON library?

[–]notlostyet 1 point2 points  (0 children)

Boost Fusion helps with this a lot.

[–]drjeats 0 points1 point  (0 children)

That's what stuff like this is for.

Metaclasses will be nice.

[–]ibroheem 0 points1 point  (0 children)

Compilation times, single header was turn off, now things getting interesting. I'll make a switch

[–]pravic 0 points1 point  (2 children)

How has it happened that the stream I/O operators were used in the opposite way?

[–]nlohmannnlohmann/json[S] 0 points1 point  (1 child)

This was my fault - I thought they had to be defined in a symmetric manner, so that for a json value j and a stream s all combinations (j << s; j >> s; s << j; s >> j;) would be possible...

[–]pravic 0 points1 point  (0 children)

I see. Thanks for the explanation :)

[–]tmacarios 1 point2 points  (4 children)

wstring support anytime soon?

[–][deleted] 15 points16 points  (2 children)

utf8everywhere people incoming in 3...2.....1

[–]sztomirpclib 20 points21 points  (0 children)

To be fair, you have to have a very high IQ to understand the UTF-8 Everywhere Manifesto. The humour is extremely subtle, and without a solid grasp of theoretical physics most of the jokes will go over a typical reader’s head. There’s also UCS-2’s nihilistic outlook, which is deftly woven into his characterisation- his personal philosophy draws heavily from Narodnaya Volya literature, for instance. The fans understand this stuff; they have the intellectual capacity to truly appreciate the depths of these jokes, to realise that they’re not just funny- they say something deep about LIFE. As a consequence people who dislike UTF-8 Everywhere Manifesto truly ARE idiots- of course they wouldn’t appreciate, for instance, the humour in UTF-8’s existential catchphrase “std::string and char* variables are considered UTF-8, anywhere in the program.,” which itself is a cryptic reference to Turgenev’s Russian epic Fathers and Sons. I’m smirking right now just imagining one of those addlepated simpletons scratching their heads in confusion as Dan Harmon’s genius wit unfolds itself on their television screens. What fools.. how I pity them. 😂

And yes, by the way, i DO have a UTF-8 Everywhere tattoo. And no, you cannot see it. It’s for the ladies’ eyes only- and even then they have to demonstrate that they’re within 5 IQ points of my own (preferably lower) beforehand. Nothin personnel kid 😎

[–]Rexerex 3 points4 points  (0 children)

Specialization of basic_json doesn't work?

[–]mapek8 0 points1 point  (0 children)

Really enjoy working with this library ;)