3 ms·
Well, JSON would take all of an afternoon to write in pure Python or in the new C extension interface. PIL a little more, still quite fast to port though (a mo
by coldtea 12y ago
Well, JSON would take all of an afternoon to write in pure Python or in the new C extension interface.
PIL a little more, still quite fast to port though (a month or so).
No reason why Numpy and Scipy couldn't be written for a new C extension interface too, though that would take much more time (1-2 years).
Thing is, with 10-20 million dollars, Google could have sponsored all of the above.
- nostrademons 12y agoAn afternoon to write, and then a year or more to work out all the bugs & corner-cases, write the documentation, and convince everyone to switch. Writing the code is rarely the hard part. There's a whole ecosystem around libraries and languages that takes time to build.
- coldtea 12y ago>An afternoon to write, and then a year or more to work out all the bugs & corner-cases, write the documentation, and convince everyone to switch. For a JSON parser? I think you overestimate the difficulty in implementing one. If anything, a parser for such a format is one of the easiest things to know you got correct -- there are extensive test suites. As for switching to it, Python users already use several JSON libs anyway, so it's not like adopting another would be any great deal. For the other libs, like numpy etc, yes, it would be more effort, but nothing unsurmountable. And speed is a far greater hook to get users to adopt that version of Python than "we now got unicode all over and fixed a couple more annoyances".
- RubyPinch 12y ago> so it's not like adopting another would be any great deal. Isn't there a pure-python json parser in the standard lib already?
- unimpressive 12y agoI don't know if it's pure python but. import json Does in fact give you a working JSON parser. I wasn't aware there was a different one to use.
- masklinn 12y agoThere's quite a few json parsers for python: * the standard library's json, which stems from a merge of simplejson way back * simplejson * ujson which can be much faster but is not exactly sound[0] * cjson * jsonlib * demjson * pyyaml (since yaml is a json superset) [0] http://mod16.org/hurfdurf/?p=266 http://mod16.org/hurfdurf/?p=266
- jlarocco 12y agoJudging by how slowly projects (especially ones that depend on the C API) have moved from Python2 to Python3, I think you're underestimating the effort required. Maybe money and promises of better performance would solve that problem, too.