Hi,

On Tue, Sep 27, 2011 at 11:52 PM, Mark <[email protected]> wrote:
> On Tuesday, September 27, 2011, Thiago Macieira <[email protected]> wrote:
>> On Tuesday, 27 de September de 2011 06:20:17 Girish Ramakrishnan wrote:
>>> Hi,
>>>
>>> On Tue, Sep 27, 2011 at 1:40 AM, Thiago Macieira <[email protected]> wrote:
>>> > JSON support is provided by many different implementations already. I
>>> > don't
>>> > think we can choose one right now. So we should simply list all the
>>> > available ones and apply the Darwin principle: standardise on the one
>>> > that survives.
>>> Here's one I wrote based on QLALR and it's way faster than the (very
>>> popular) qjson (benchmarks are in the repo):
>>> http://gitorious.org/qjsonparser/qjsonparser.
>>>
>>> Does V8 have it's own json parser that we can use?
>>
>> That's why I said we have 5 different JSON parsers today and Darwin should
>> determine which one we'll pick.
>>
> About V8, Qt is gonna use that right? I'm guessing V8 has it's own uber fast
> json parser so why not make a qt layer for that..? Seems like that gives no
> duplication and json in c++, everyone happy :)
>

AFAICT, v8's json parser is written in JavaScript. I don't think it's
a problem that it's not in C++, though. What I do think is a problem
is that apps now need to have v8 just to use JSON (maybe this is an
imaginary problem).

If I understood Thiago, he would prefer to 'wait and see which one
survives'. I would instead like us to choose one and provide an api
for JSON in qtbase, asap. Pretty much every project I work with needs
JSON these days. JSON implementation is quite trivial anyway (like
~200-300 lines max), so I don't see the need to have competing
implementations 'fight it out'.

Does anyone have a strong opinion on what API we should have for a
JSON parser in Qt? I quite like the qjson approach of just providing a
QVariant. QVariant conversion has a performance overhead but it's very
easy to work with and from what I have seen the big performance impact
is in the parsing phase and not when getting data out of the QVariant.
The alternate is a stream based API like the XML one but I think this
is just too cumbersome.

Girish
_______________________________________________
Qt5-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback

Reply via email to