What is the most mature JSON library for Erlang?

后端 未结 6 1094
日久生厌
日久生厌 2020-12-05 18:54

I wanted to use YAML but there is not a single mature YAML library for Erlang. I know there are a few JSON libraries, but was wondering which is the most mature?

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-05 19:34

    My favourite is mochijson2. The API is straightforward, it's fast enough for me (I never actually bothered to benchmark it though, to be honest--I'm mostly en- and de-coding small packets), and I've been using it in a stable "production server" for a year now or so. Just remember to install mochinum as well, mochijson2 uses it to encode large numbers, if you miss it, and you'll try to encode a large number, it will throw an exception.

    See also: mochijson2 examples (stackoverflow)

提交回复
热议问题