[Xapian-tickets] [Xapian] #523: Migrate from XS Search::Xapian to SWIG version

Xapian nobody at xapian.org
Fri Apr 17 06:44:49 BST 2020


#523: Migrate from XS Search::Xapian to SWIG version
----------------------------+-------------------------------
 Reporter:  Olly Betts      |             Owner:  Olly Betts
     Type:  defect          |            Status:  assigned
 Priority:  normal          |         Milestone:  1.5.0
Component:  Search::Xapian  |           Version:  git master
 Severity:  normal          |        Resolution:
 Keywords:                  |        Blocked By:
 Blocking:                  |  Operating System:  All
----------------------------+-------------------------------

Old description:

> This ticket is to track the issues remaining to solve before the SWIG
> Perl bindings are a complete replacement for the XS ones.
>
>  * ~~~{{{"$it"}}} doesn't work in SWIG, while in XS it dereferences (for
> !TermIterator and !ValueIterator at least).  I did some digging last year
> and it seemed there was some problematic interaction with eq/ne which I
> didn't get to the bottom of.~~~
>  * ~~~"Stringify" is also missing for subclasses of Error (which in the
> XS version I'm using in 1.2.4 to give backwards compatibility for cases
> which were still throwing string exceptions in 1.2.3).~~~
>  * XS version has simple anon-sub wrappers for !MatchDecider and
> !ExpandDecider.  SWIG doesn't support directors for Perl in current
> releases (though there's work on a branch).  But perhaps we can support
> these simple wrappers without needing directors.
>  * ~~~The SWIG-generated version is fussier about what sort of scalars
> you pass - for example, if an integer is expected, passing a string
> containing an integer or floating point number doesn't work, at least in
> some cases.~~~ Now documented at least.
>
> One option is to deprecate the stringify stuff and make the switch at the
> start of the next release series.

New description:

 This ticket is to track the issues remaining to solve before the SWIG Perl
 bindings are a complete replacement for the XS ones.

  * ~~~{{{"$it"}}} doesn't work in SWIG, while in XS it dereferences (for
 !TermIterator and !ValueIterator at least).  I did some digging last year
 and it seemed there was some problematic interaction with eq/ne which I
 didn't get to the bottom of.~~~
  * ~~~"Stringify" is also missing for subclasses of Error (which in the XS
 version I'm using in 1.2.4 to give backwards compatibility for cases which
 were still throwing string exceptions in 1.2.3).~~~
  * ~~~XS version has simple anon-sub wrappers for !MatchDecider and
 !ExpandDecider.  SWIG doesn't support directors for Perl in current
 releases (though there's work on a branch).  But perhaps we can support
 these simple wrappers without needing directors.~~~
  * ~~~The SWIG-generated version is fussier about what sort of scalars you
 pass - for example, if an integer is expected, passing a string containing
 an integer or floating point number doesn't work, at least in some
 cases.~~~ Now documented at least.

 One option is to deprecate the stringify stuff and make the switch at the
 start of the next release series.

--
Comment (by Olly Betts):

 I've added support for passing a Perl sub for simple functor classes in
 d5d26eb54bfb68e1674b8f0e314de29e81e16b1d.

 SWIG now supports directors for Perl so we should be able to support
 subclassing, but accepting a Perl sub as an alternative still seems useful
 for simple cases (it'd be nice to support for C++ too).

 I think the coding work for this ticket is now done (unless further
 incompatibilities are found), but we should make sure the documentation
 reflects the updated status of the SWIG-generated Perl bindings.
-- 
Ticket URL: <https://trac.xapian.org/ticket/523#comment:21>
Xapian <https://xapian.org/>
Xapian


More information about the Xapian-tickets mailing list