Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-25 06:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found