* [PATCH] Mail::Notmuch Perl wrapper
@ 2010-01-25 18:17 Simon Cozens
2010-01-25 19:10 ` Mike Kelly
2010-01-26 3:30 ` Ben Gamari
0 siblings, 2 replies; 5+ messages in thread
From: Simon Cozens @ 2010-01-25 18:17 UTC (permalink / raw)
To: notmuch
[-- Attachment #1: Type: text/plain, Size: 317 bytes --]
(Resent with compressed patch)
Hi there,
Here's a Perl library, Mail::Notmuch, which wraps the notmuch library.
I've attached it because it's pretty huge. It requires you to
build notmuch as a shared library - there's a patch on the mailing list
earlier which does that.
Notmuch else to say, really. Enjoy.
Simon
[-- Attachment #2: Mail-Notmuch-perl.patch.gz --]
[-- Type: application/x-gzip, Size: 55832 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Mail::Notmuch Perl wrapper
2010-01-25 18:17 [PATCH] Mail::Notmuch Perl wrapper Simon Cozens
@ 2010-01-25 19:10 ` Mike Kelly
2010-01-26 3:30 ` Ben Gamari
1 sibling, 0 replies; 5+ messages in thread
From: Mike Kelly @ 2010-01-25 19:10 UTC (permalink / raw)
To: Simon Cozens, notmuch
On Mon, 25 Jan 2010 18:17:16 +0000, Simon Cozens <simon@simon-cozens.org> wrote:
> (Resent with compressed patch)
>
> Hi there,
> Here's a Perl library, Mail::Notmuch, which wraps the notmuch library.
> I've attached it because it's pretty huge. It requires you to
> build notmuch as a shared library - there's a patch on the mailing list
> earlier which does that.
> Notmuch else to say, really. Enjoy.
Hey, I was working on that! :p
But, thanks. I'll probably be giving you more thorough feedback soon.
--
Mike Kelly
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Mail::Notmuch Perl wrapper
2010-01-25 18:17 [PATCH] Mail::Notmuch Perl wrapper Simon Cozens
2010-01-25 19:10 ` Mike Kelly
@ 2010-01-26 3:30 ` Ben Gamari
2010-01-26 8:34 ` Simon Cozens
1 sibling, 1 reply; 5+ messages in thread
From: Ben Gamari @ 2010-01-26 3:30 UTC (permalink / raw)
To: notmuch
Excerpts from Simon Cozens's message of Mon Jan 25 13:17:16 -0500 2010:
> (Resent with compressed patch)
>
> Hi there,
> Here's a Perl library, Mail::Notmuch, which wraps the notmuch library.
> I've attached it because it's pretty huge. It requires you to
> build notmuch as a shared library - there's a patch on the mailing list
> earlier which does that.
I know practically nothing about writing Perl bindings, but it seems
like this might be work better left to a bindings generator. I currently
have a patch which enables binding generation through SWIG. It works
well, although SWIG unfortunately doesn't have very good support for
exposing object-oriented C interfaces like notmuchs' through the target
language's type system. Nonetheless, this is easily done by a wrapper
library to prettify the binding (which in the case of Python took very
little time).
I sent the patchset out a few weeks ago, but I'll rebase it on top of my
shared-library branch and send it out again tonight.
Cheers,
- Ben
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Mail::Notmuch Perl wrapper
2010-01-26 3:30 ` Ben Gamari
@ 2010-01-26 8:34 ` Simon Cozens
2010-01-26 15:51 ` Ben Gamari
0 siblings, 1 reply; 5+ messages in thread
From: Simon Cozens @ 2010-01-26 8:34 UTC (permalink / raw)
To: Ben Gamari; +Cc: notmuch
On 26/01/2010 03:30, Ben Gamari wrote:
> I know practically nothing about writing Perl bindings,
I recommend http://www.manning.com/jenness/ ;)
> but it seems
> like this might be work better left to a bindings generator. I currently
> have a patch which enables binding generation through SWIG. It works
> well, although SWIG unfortunately doesn't have very good support for
> exposing object-oriented C interfaces like notmuchs' through the target
> language's type system.
Yes, this is why I chose not to use SWIG: if I'm going to automatically
get code that doesn't do what I want and then have to manually write
code that does, why not just manually write code that does? (well,
semi-manually: xsubpp extracted all the function signatures for me.)
I guess the advantage of SWIG is that it gets you code that you don't
want in many different languages.
Anyway, whichever way you do it, you'll still need the class
documentation and the tests - feel free to take them from my patch if
you end up going the SWIG route for Perl.
Simon
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Mail::Notmuch Perl wrapper
2010-01-26 8:34 ` Simon Cozens
@ 2010-01-26 15:51 ` Ben Gamari
0 siblings, 0 replies; 5+ messages in thread
From: Ben Gamari @ 2010-01-26 15:51 UTC (permalink / raw)
To: Simon Cozens; +Cc: notmuch
Excerpts from Simon Cozens's message of Tue Jan 26 03:34:57 -0500 2010:
>
> Yes, this is why I chose not to use SWIG: if I'm going to automatically
> get code that doesn't do what I want and then have to manually write
> code that does, why not just manually write code that does? (well,
> semi-manually: xsubpp extracted all the function signatures for me.)
>
You bring up a very good point here. It seems like Perl is nice in that
it has tools that allow you to easily bring up a set of bindings.
Unfortunately, it seems that many other languages (Python included)
aren't as well endowed.
> I guess the advantage of SWIG is that it gets you code that you don't
> want in many different languages.
>
This is actually precisely my logic. It saves you the work of having to
do the grunt work of writing the glue for each of the signatures.
However, it seems that in some languages this isn't nearly as difficult.
> Anyway, whichever way you do it, you'll still need the class
> documentation and the tests - feel free to take them from my patch if
> you end up going the SWIG route for Perl.
>
You might have the right approach in not choosing a cookie-cutter
solution for binding generation. There certainly are tools[1][2][3] for
Python that make the job a great deal easier. Maybe these would be a
better choice. Ultimately, we'd probably end up with more code to
maintain, however the end result would likely be cleaner than the
current stacked bindings approach. What do people think?
- Ben
[1] http://www.cython.org/
[2] http://freshmeat.net/projects/python-sip/
[3] http://code.google.com/p/pybindgen/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-01-26 15:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-25 18:17 [PATCH] Mail::Notmuch Perl wrapper Simon Cozens
2010-01-25 19:10 ` Mike Kelly
2010-01-26 3:30 ` Ben Gamari
2010-01-26 8:34 ` Simon Cozens
2010-01-26 15:51 ` Ben Gamari
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).