From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eF5kAU+E9GCvCwAAgWs5BA (envelope-from ) for ; Sun, 18 Jul 2021 21:43:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KAuoOE6E9GBYMQAAbx9fmQ (envelope-from ) for ; Sun, 18 Jul 2021 19:43:10 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AEA2E2BFE7 for ; Sun, 18 Jul 2021 21:43:10 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id ECF70290BC; Sun, 18 Jul 2021 15:43:05 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 79D8B290BA for ; Sun, 18 Jul 2021 15:43:03 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 3B46D5FD21; Sun, 18 Jul 2021 15:43:03 -0400 (EDT) Received: (nullmailer pid 4070978 invoked by uid 1000); Sun, 18 Jul 2021 19:43:02 -0000 From: David Bremner To: Hannu Hartikainen , notmuch@notmuchmail.org Subject: Re: Early preview of s-expression based query parser In-Reply-To: <60f190f8.1c69fb81.7e7d2.40d1@mx.google.com> References: <20210714000239.804384-1-david@tethera.net> <60f190f8.1c69fb81.7e7d2.40d1@mx.google.com> Date: Sun, 18 Jul 2021 16:43:02 -0300 Message-ID: <87fswb76ih.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: FKKFKYBAAQDE474ZUHABFEFBGWJHC3YI X-Message-ID-Hash: FKKFKYBAAQDE474ZUHABFEFBGWJHC3YI X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626637390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1eSCkF5n1IRMgdXV5ZSAOcb9q1nIMVSh9eneJ5U6at4=; b=Y1cIkKXlFcVIARHICWdGaaam3qQdySVqjBkmMhNHQzdq51bpxnn5eNWghMfcgT54US1kNx 5paY6hY+3J+059jSPAvml46rw225PmfhbJQMjdaAyOGzNUonlKgHTXcag4cAEOdFRgsgpV jqdxCdnBG0xQcmUDLkMKTfk1dJNN9aAftW1UPUD4HOW025A2ASOCZQm59TnVOyKW8140aj BtK0+eJ3N597HKI1DiNOqtjl77ThiYeRqsg5vuWFuBojexsA3FzDZ2GDBkXqkQBmxnRzwz CCN0rvCA1jdzmo5G94MU05O8vc2tat+vN06eMN32JjX5/N2qqLkBPfCG2IYLtA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626637390; a=rsa-sha256; cv=none; b=U7/nlPUWmRlocebaTbXQqhNMBqMx0kIr8jUrQo5YjCnvcDXHEj3bieaBdnXWvstpc5lXdx NgK3yasdIAb/PviK3AtAj89hzg8zVTIbahGDe3dme0Ma1wvmOPJUJPIY4GebGpaR8jsm6F az+YTpmkHPZAA1KUnmhkgi6136mbHi1L1dXpezoXk7PQIMA0fwoWFlF+bQRBKpvneH+/4P svIcLo5IADr1Qi4KNqyiclLWk5x0+W5GoJNKpklXb0gTs9JvOJ9/aI9natd487NaSWqH5b AaNHqhVWVTbh+1P4VzLg+a2PVx1qHKdV5ydeZwJfduPxZQ8dRNsFB8uRXdIy8A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -2.05 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: AEA2E2BFE7 X-Spam-Score: -2.05 X-Migadu-Scanner: scn0.migadu.com X-TUID: wLRB3yPrvR65 Hannu Hartikainen writes: > > But looking at the sexp parser and the implementation of logical > connectors I can't help but think that isn't this patchset implementing > a tiny subset of a lisp? And wouldn't a full embedded lisp be much, much > more powerful? I think the analogy here is between JSON, and JavaScript. Plenty of programs find it useful to use JSON as an input format without embedding JavaScript. That's not just because JavaScript is not everyone's favourite programming language, but because a Turing complete input language is a mixed blessing. > I'd at least consider embedding something like s7 [0] or Janet [1], > writing bindings for enough Xapian functionality, and then writing the > rest in the lisp itself. That way you'd get a more powerful and > extensible sexp implementation, and you'd implement most of it in a much > more ergonomic language. Since what I want to do is actually a fairly thin layer on top of the Xapian API, it's not clear that writing the bindings would be less code than the roughly 450 lines of C/C++ needed to parse the s-expressions. We already face challenges maintaining bindings for Python and Ruby; I suspect that finding people to work on bindings for fairly obscure (defined by not being in Debian) lisp variants would not be easier. Ditto for coding in said lisp in the notmuch core. > Of course I don't really know Xapian and I'm not sure of the design > goals of this sexp parser, but my experience with HoneySQL [2] tells me > that building queries with a lisp from lisp data structures can be > unbelievably powerful. Sure, and one of the motivations is to be able to conveniently build queries in emacs lisp (some other lisp would obviously work just as well). If someone wants to take on a more ambitious project involving a full lisp, that probably makes the most sense as a client project that links to notmuch. That leaves someone free to explore without waiting on our somewhat ponderous development cycle. d