Tencent / rapidjson

A fast JSON parser/generator for C++ with both SAX/DOM style API
http://rapidjson.org/
Other
14.23k stars 3.53k forks source link

Support for HJSON #1377

Open Yzrsah opened 6 years ago

Yzrsah commented 6 years ago

Hello,

My app uses many data configuration files.

The files are in the HJSON format. Due to performance concerns, we attempted to switch from HJSON to JSON utilizing rapidjson.

The users of the app were very unhappy, as adding the operators and extra symbols all around significantly complicated the files. I got countless requests to put the old behavior back with HJSON. It basically ruined the elegance and simplicity of what the users were used to being able to write.

The JSON format is good for serialization, but it is not the best for configuration and data authoring due to the requirement for excessive operator usage.

Due to this, I basically have no choice. Either I use the slow implementation of 'hjson-cpp' or the rapidjson needs support for some relaxed format.

Perhaps some sort of modular profile system capable of supporting multiple relaxed syntaxes could work. There's a few different relaxed JSON syntaxes but they are pretty similar, all with the same important additions like the ability to use comments.

miloyip commented 6 years ago

RapidJSON does support some relaxed syntax, See #36. But it may not support all the syntax required.