On Tue, Jul 17, 2012 at 8:59 AM, Kurt Starsinic <[email protected]> wrote: > If we decide that we really like Jansson (or any other C-ish parser), > I'm more than happy to write an XSUB wrapper for it. I have a lot of > experience with that.
XS expertise is very valuable -- there aren't that many people that know it well, so it's cool to see your offer! :) Lucy doesn't need to add Jansson as a dependency because we already have our own tightly integrated JSON parser -- see LUCY-133: <http://s.apache.org/9WP>. The background is that Lucy is written in something sort of like XS itself: an OO toolkit called "Clownfish". Here are some rough datatype mappings: Perl Clownfish Ruby Jansson ==== ============= ======= ======= HV cfish_Hash RHash json_t AV cfish_VArray RArray json_t SV cfish_CharBuf RString json_t In the past, Lucy relied on the CPAN module JSON::XS for encoding and decoding JSON. That meant that when we needed to read in some JSON for use by the Lucy core, the data would first be read into Perl data structures (HV, AV, SV) by JSON::XS but then had to go through a deep conversion to Clownfish data structures (Hash, VArray, CharBuf, etc). When we switched to our own custom JSON module which reads into Clownfish data structures directly, that extra conversion stage was eliminated, speeding things up. If we had gone with Jansson instead of rolling our own JSON module, we would have had to write bridge code to convert Jansson's `json_t` data structures to our Clownfish types, and we would still be paying the cost of deep conversion. Plus Jansson's json_t API isn't small, FWIW: http://www.digip.org/jansson/doc/2.3/apiref.html#value-representation Nevertheless, even if we don't need Jansson-to-Perl bindings for Lucy, there are still some interesting opportunities around here for people who know XS. Clownfish is designed to integrate closely with a "host" language, and CFC, the Clownfish compiler, autogenerates a lot of XS code for Lucy's Perl bindings. Hacking on the CFC code that generates XS is a fun and challenging project. Alternately, if you have knowledge of the C apis for other dynamic languages, or if you would like to acquire such knowledge, you could work on building CFC bindings for them instead. Logan and I have both put in some time on the CFC Ruby bindings, motivated partly by a desire to enrich our understanding of dynamic language design in general and Ruby in particular. > P.S. I've edited the original message, because the last time I replied > it was rejected as spam. If you snoop the headers of the rejected mail, you will find a breakdown of what contributed to the spam score. FWIW, the most common problem is that the ASF SpamAssassin config strongly dislikes mail in HTML format as opposed to plain text. Marvin Humphrey
