What is the most mature JSON library for Erlang?

17,433

Solution 1

Have a look at the one from mochiweb: mochijson.erl

1> mochijson:decode("{\"Name\":\"Tom\",\"Age\":10}").   
{struct,[{"Name","Tom"},{"Age",10}]}

Solution 2

I prefer Jiffy. It works with binary and is realy fast.

1> jiffy:decode(<<"{\"Name\":\"Tom\",\"Age\":10}">>).
{[{<<"Name">>,<<"Tom">>},{<<"Age">>,10}]}

Can encode as well:

2> jiffy:encode({[{<<"Name">>,<<"Tom">>},{<<"Age">>,10}]}).
<<"{\"Name\":\"Tom\",\"Age\":10}">>

Solution 3

Also check out jsx. "An erlang application for consuming, producing and manipulating json. Inspired by Yajl." I haven't tried it myself yet, but it looks promising.

As a side note; I found this library through Jesse, a json schema validator by Klarna.

Solution 4

I use the json library provided by yaws.

Edit: I actually switched over to Jiffy, see Konstantin's answer.

Solution 5

Trapexit offers a really cool search feature for Erlang projects.

Lookup for JSON there, you'll find almost 13 results. Check the dates of the latest revisions, the user rating, the project activity status.

UPDATE: I've just found a similar question n StackOverflow. Apparently, they are quite happy with the erlang-json-eep-parser parser.

Share:
17,433
yazz.com
Author by

yazz.com

CEO, Solidity and Web3 developer at https://yazz.com

Updated on June 05, 2022

Comments

  • yazz.com
    yazz.com almost 2 years

    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?