[erlang-questions] fast JSON parser in C
Serge Aleynikov
saleyn@REDACTED
Sat Jul 26 19:51:06 CEST 2008
Bob Ippolito wrote:
> On Fri, Jul 25, 2008 at 6:48 PM, Serge Aleynikov <saleyn@REDACTED> wrote:
>> Not sure about others but I do find this "variant of JSON" more convenient
>> when it comes to debugging JavaScript in a browser (using Firebug debugger)
>> as it is visually more compact and not taking as much of screen real estate.
>
> With firebug you can just look at the objects themselves once they're evaluated.
That is if JSON content coming to a web client is properly formed.
During the
development stage when a client fetches some JSON content read from the
server's
filesystem (say metadata descriptor of a dynamic grid object) it is not
guaranteed
to be properly formed. This is when inspecting "raw" JSON at the
client-side's
debugger comes in handy, and protocol succinctness brings value.
>>>> The first form seems more natural for an Erlang programmer, and if JSON
>>>> BIF parser is included in the OTP, perhaps a customization to support
>>>> this variant of the format would be a worthwhile addition as most
>>>> frequently JSON is used for interaction with browsers that happily
>>>> accept the first, more compact, form.
>>> That's just a bad idea. If you intend to do that, don't call it JSON
>>> because it's not.
>>> Not every JSON client is a JavaScript interpreter
>>> using eval().
>> Perhaps using JSON name for the JSON protocol was a misnomer in the first
>> place, as it has very little to do with JavaScript other than resembling its
>> object notation?
>
> It's not any worse than the name JavaScript to begin with.
At least Javascript Object specification came well before JSON and
deserves a merit. Choosing JSON name for the protocol created a lot of
confusion as many people think that it has much in common with
Javascript Objects. Alas, the issue with double-quoting object keys has
been discussed on the web quite a number of times...
Serge
More information about the erlang-questions
mailing list