Replies: 1 comment 1 reply
-
The relationships are complex. No doubt about that. The JSON gem and Oj take different approaches to parsing JSON. By using different approaches Oj has been able to hold a performance gain over the JSON gem. The situation is worse still in that Rails introduces yet another set of APIs. Oj in compat more should act just like the JSON gem. If some of the other Oj features are desired or preferred they are available. Trying to force all JSON parsing and output to have exactly the same APIs will only work if one get is picked and the others discarded if for no other reason than the module names will not be the same. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Would it be possible to improve the compatibility of JSON parsers/generators and avoid things like
multi_json
by extending theJSON
interface?I don't know how much we can achieve here, but if we standardised
JSON#generator=
andJSON#parser=
or something like that, we could make pluggable JSON more easy, and less monkey-patchy. I'd be happy to try and propose that for Ruby 3.3+.I actually don't know the full extent of how compatible those interfaces are across CRuby, TruffleRuby and JRuby, but I assume there is some level of standardisation. Feel free to educate me if you can fill in the gaps.
Beta Was this translation helpful? Give feedback.
All reactions