From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 5544D1F463; Sat, 21 Sep 2019 22:40:03 +0000 (UTC) Date: Sat, 21 Sep 2019 22:40:03 +0000 From: Eric Wong To: meta@public-inbox.org Subject: libgmime experiences? (was: [PATCH] doc: update HACKING and TODO ...) Message-ID: <20190921224003.GA21832@dcvr> References: <20190921000642.7290-1-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190921000642.7290-1-e@80x24.org> List-Id: Eric Wong wrote: > --- a/HACKING > +++ b/HACKING > @@ -40,7 +40,8 @@ the shiny new. > Avoid relying on compiled modules too much. Even if it is Free, > compiled code makes packages more expensive to audit, build, > distribute and verify. public-inbox itself will only be implemented > -in scripting languages (currently Perl 5). > +in scripting languages (currently Perl 5) and optional JIT-compiled C > +(via Inline::C) I'm considering adding libgmime support after the 1.2 release and creating an Email::MIME/msg_iter-compatible wrapper based on it. I've never used gmime as a user or hacker... Pure-Perl Email::MIME will remain supported, though new versions of Email::MIME use Email::Address::XS so there's already a C/XS component which increases installation overhead. My thoughts on gmime so far: One big reason gmime looks good to me is that it offers mmap and pipe APIs, so it hopefully deals well with big messages and won't bloat/fragment the heap. Another is Email::Simple::Header::_header_to_list being at the top of some profiles, and I'm not convinced I could make it faster. gmime's been through several incompatible API/ABI versions, but it seems Debian can support at least 2.6 and 3.0. FreeBSD has 2.2, 2.4, 2.6 and 3.0, even! gmime upstream also provides a PORTING document which should come in handy. The MIME::Fast wrapper for libgmime exists on CPAN, but that hasn't been updated in years and isn't in Debian. Both 3.0 and 2.6 APIs could be supported in parallel using Inline::C, and more can be added in the future. notmuch uses gmime, as does a lot of desktop software. My experience with mainstream "desktop software" hasn't been good, as they tends to be less stable in both user/programming interfaces, and also more complex and difficult to debug than server-oriented software. However, looking at the Debian changelogs, there's only been one CVE (CVE-2010-0409) from nearly a decade ago. Maybe all the bugs are fixed, or nobody really abuses it. In any case, if I go through with this, I'll be running lots of mail and random junk through it to ensure it doesn't break unexpectedly.