From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 794AC6DE0191 for ; Wed, 29 Nov 2017 12:44:56 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.168 X-Spam-Level: X-Spam-Status: No, score=0.168 tagged_above=-999 required=5 tests=[AWL=-0.062, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z2pp29bXiypf for ; Wed, 29 Nov 2017 12:44:55 -0800 (PST) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by arlo.cworth.org (Postfix) with ESMTPS id EE4B06DE00C4 for ; Wed, 29 Nov 2017 12:44:54 -0800 (PST) Received: by mail-wm0-f43.google.com with SMTP id y82so37864709wmg.1 for ; Wed, 29 Nov 2017 12:44:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version; bh=bHmeyJui6m8uew/h+Qg5p3gkVtUGpbE5t3E15jyhh58=; b=Eb91kX2TzC4t7daIRhGd/XoqkgmOyu8KKhai1uLzJmOiaIrXvJJU6KlAt/yMAaaNQF pXaiRna3LjzBXFMPg9C7D6xaTMxf3FoCQl6z1JBpz390xgRC5Fp9+jrjTI0Idlywj+Yo uA5ZuEAXaYVp1ZTQjlLYs9L0txfq3UJyckbxRpoMpqZvPZe+J8wE9I6gTWazX0Hel6CB /csPW+HKRypor3rsNr1U2hX4GMYZh8dakcJjzb1bP2eIVZwWRQoNZislavK2mZiYJ4BU luz3gOE2xMT6KvzXZGTZfWvVu0IgAJntu1byLjp7LMzyo+PThh6L0Mo714wnrkMIuIV+ EyMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:in-reply-to:references :date:message-id:mime-version; bh=bHmeyJui6m8uew/h+Qg5p3gkVtUGpbE5t3E15jyhh58=; b=OLam7q0/Y10Cu7EZL2GsUT8gYKUkTYWbkd8RVnAyrypc9UIH8viiFIIA2H8QEwkEa/ iJPNhvT74N74LfrwGSpi6NchRdTHmUgHOkGL6luf7pyhUcCx6Hu0GmQYm8pVtFPeUBi4 TlAVL9cnc/9yzjvAlZo3UeJCy3UwuwhNsY5RXl30+iHl6ENOLcya+HwHn/5IzUUNPHVJ TkLyT6Dgy2jMMkp60zE+m+2aTDEb/mZd9fV0Op+PU9384ICxIsVbCawD1TQJ4i8j2Y4U zwOWl+Lo+Wf5LLyZQjy8R1sa0xr5qBQ0ZBFd0/xipeS/S5YOCK/Zs33Lmx/Hn4QxLqSG bLcQ== X-Gm-Message-State: AJaThX6d0RWIV4ti/rhLWnqhM8ujl6LjinrG3pfZgXa9enWzUPuEubJl k742AaTbdgt0eUm7wRmMT3cogRMw X-Google-Smtp-Source: AGs4zMYRtmh5qe39Dpu6qNAZohkPTJb6g7mDsIyYtjF+oznv3hg267nzBU7I4NLWL/sdQeb1TWlj9Q== X-Received: by 10.80.214.74 with SMTP id c10mr9200604edj.271.1511988292593; Wed, 29 Nov 2017 12:44:52 -0800 (PST) Received: from devork.be ([2a02:168:58e4::7a3]) by smtp.gmail.com with ESMTPSA id j39sm2404858ede.38.2017.11.29.12.44.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Nov 2017 12:44:51 -0800 (PST) Sender: Floris Bruynooghe Received: (nullmailer pid 23550 invoked by uid 1000); Wed, 29 Nov 2017 20:44:50 -0000 From: Floris Bruynooghe To: notmuch@notmuchmail.org Subject: Re: DRAFT Introduce CFFI-based Python bindings In-Reply-To: <87po82vtsx.fsf@tethera.net> References: <20171128204608.12210-1-flub@devork.be> <87po82vtsx.fsf@tethera.net> Date: Wed, 29 Nov 2017 21:44:50 +0100 Message-ID: <874lpcg6gt.fsf@devork.be> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Nov 2017 20:44:56 -0000 David Bremner writes: > Floris Bruynooghe writes: > >> >> Lastly there are some downsides to the choices I made: >> - I ended up going squarely for CPython 3.6+. Choosing Python >> 3 allowed better API design, e.g. with keyword-only parameters >> etc. Choosing CPython 3.4+ restricts the madness that can >> happen with __del__ and gives some newer (tho now unused) >> features in weakref.finalizer. >> - This is no longer drop-in compatible. >> - I haven't got to a stage where my initial goal of speed has >> been proven yet. > > I guess you'll have to convince the maintainers / users of alot and afew > that this makes sense before we go much further. I'd point out that > Debian stable is only at python 3.5, so that makes me a bit wary of this > (being able to run the test suite on debian stable and similar aged > distros useful for me, and I suspect other developers). > > I know there are issues with memory management in the current bindings, > so that may be a strong reason to push to python 3.6; it seems to need > more investigation at the moment. So on earlier Python versions, sure this is possible at not too much cost. - Python 3.4+ would just cost the use of some f-strings. Not major, was just nice to use. - Python <3.4 afaik would only need a tweak to the Database.tags and Message.tags properties. I *think* swapping the caching of these using a weakref should suffice and not break the brittle Python-libnotmuch memory management. Mind you I think Python 3.0-3.3 are pretty old and not much point in supporting them. But this would also apply for 2.7 support. - Python 2.7 is probably the worst, in that keyword-only arguments would be gone. If python 2.7 is required I'd be much keener to have another go at a drop-in replacement with the memory safety features and then build the "notdb" API on top off it. But for that to be worth it people need to be convinced enough that maintaining a CFFI version is nicer than a ctypes version I guess. Kind regards, Floris