JSON::XS is not thread-safe (crashes mod_perl in production) and seems to have a memory leak (I see oob on apache after some time...)
All the other JSON's are stupidly slow.
JSON:XS (and all the others) are riddled with "croak" statements - making them unusable in production without wrapping them in "eval()".
eval makes JSON::XS even slower than JSON::PP

Philosophically - I strongly disagree with the concept of ever using "croak" on broken input - that's a fast-track way to derail production code... but that's just my opinion (based on a mere 37 years of programming every day).

The spec looks *really* simple: https://datatracker.ietf.org/doc/html/rfc8259 - with the exception of the unicode mess (which is the prime candidate for many of the croak deaths I observe above, and possibly the memory-leak.)

Is there any really-good C programmer here, who wants to engrave their name in history by writing a correct and stable JSON module, that can be safely used in scripts without any eval() needed ?

Suggestion: code some flags so that we users can specify the behaviour (in case some masochist actually wants to croak themselves), and other useful features (e.g. python interoperability including NaN, -inf, and other non-standard stuff that despite-not-being-standard everyone still wants/uses..., stripping of javascript-unsafe or broken unicode chars, pretty-printing, canonical output, ...)

In reply to Can someone please write a *working* JSON module by cnd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.