From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WJxLJJNgA2HYcwAAgWs5BA (envelope-from ) for ; Fri, 30 Jul 2021 04:14:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EPQDIJNgA2EOZwAA1q6Kng (envelope-from ) for ; Fri, 30 Jul 2021 02:14:43 +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 211AD47F1 for ; Fri, 30 Jul 2021 04:14:43 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 3D69A290A7; Thu, 29 Jul 2021 22:14:39 -0400 (EDT) Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by mail.notmuchmail.org (Postfix) with ESMTPS id 1AE8829087 for ; Fri, 16 Jul 2021 10:00:27 -0400 (EDT) Received: by mail-lf1-x136.google.com with SMTP id i5so16197777lfe.2 for ; Fri, 16 Jul 2021 07:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:subject:to:in-reply-to:references; bh=S0CpU9gGzs1d1L1Qz/NS0LjmpcgJTkyHc1pS8yM3jPw=; b=FtCiLPvMYpsE/zmcNL/UokT7brLkYct5/FSyeor20c1PoYAWw5tSm+grbTE5b+iyeB lvhL8Fu3bHRb0Oinzon8NTqkJMDCO1LLEUA9HMWFt9WVueKrTFTdtG3wM2UIwTYtJUel aJm96JGzSZFEivEpQxDydU+jv2IdiOEfnne3uDzYXUfN2ib+CmeBAlEHD3AfqdDY/6J3 Y25pyvHMT94/a9mJHYV35g7zys+EKtH7jVvr9oUSQmiyN3idOMwmIHpkiYPQP843B3yA zUJ87csXt2sQMiTEIqUMoDzzncYJXAEfNwT2shn8V3gZRLdA9KMMsDA0fOEpqelSFxJS Xcwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:subject:to:in-reply-to :references; bh=S0CpU9gGzs1d1L1Qz/NS0LjmpcgJTkyHc1pS8yM3jPw=; b=ekaf6LyBy4cClqvtHOvFERpR+j5PXcbkY1C31nKQctHPua3JZKg7N2dvYYl5rOb/B0 ySTabPLfL7UgC6V6WlbOHu2SZUnDqK1kXfwmoiAODwtapifSkrmnhIigvHtrKrbwKuex hGP35Mu6Dibn0+fxfnK73yomTRO5e7/KHVUyc2ISuzhJkaXOXZ/bZ7gmMFmCVFbataER CR0SOPg7PC67QprGSPPGWx//3pHIhSx83BRuKlgkQ41CE9gOIBBGgfxR/2KbtSBCHv2f ZACm/g1q4mpzR05vrkDeJaDRhijCVhj0JbCRtfwLblK+r/PG+87fSCoTuPopud5WQ/Y0 S3lg== X-Gm-Message-State: AOAM530Ga5AZ9hu/rIAo8uc9EPnFvoc/KyfF+KPLU994wWEDuVWGHTPR iW2th9ecicSxXh81LQ0czcs= X-Google-Smtp-Source: ABdhPJzsazuP4hyCcvyxXOytohCFHcefDpnRQOn77sAoAqtK6oE74sZlRRMTq3S9qogXzNgEacqK4Q== X-Received: by 2002:a05:6512:b92:: with SMTP id b18mr7717801lfv.641.1626444025112; Fri, 16 Jul 2021 07:00:25 -0700 (PDT) Received: from localhost (88-112-11-80.elisa-laajakaista.fi. [88.112.11.80]) by smtp.gmail.com with ESMTPSA id u2sm655075lfd.43.2021.07.16.07.00.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jul 2021 07:00:24 -0700 (PDT) Message-ID: <60f190f8.1c69fb81.7e7d2.40d1@mx.google.com> Date: Fri, 16 Jul 2021 17:00:23 +0300 From: Hannu Hartikainen Subject: Re: Early preview of s-expression based query parser To: David Bremner , notmuch@notmuchmail.org In-Reply-To: <20210714000239.804384-1-david@tethera.net> References: <20210714000239.804384-1-david@tethera.net> X-MailFrom: hannu.hartikainen@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0 Message-ID-Hash: QYJ3NMH3EZHKX64GUDHTBLGLGR5H6SKU X-Message-ID-Hash: QYJ3NMH3EZHKX64GUDHTBLGLGR5H6SKU X-Mailman-Approved-At: Fri, 30 Jul 2021 02:14:36 -0400 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: MIME-Version: 1.0 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=1627611283; 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:dkim-signature; bh=zZ+xeSF21jbPvxYLlad8+pBParzEpwIq+pQRg+IS7S0=; b=Y8qZq5cnnvZMtaXrrH4Aiz1HeNrHUlnzJBwqdR++d6nvFwzPB1p1JQDna5uzzgxHrBuzuc Z1rIIP+rvedZVXYZlP3DaMTtr1Pat9zbiUYIOJTuWCjLwQq8hwZqO+v7WK3mq/NQY/mIq7 WLAix9iuD0ZLubBcgwIHcMZUbZi/V2irbhvA31joQ0yaCeCmphZJecV39tTSKPvYcz+iuy robw13NIpEEerFoVZpObw8atWQmPSmo3hVzwLs1KDDe65zEjjW0lrdoJViIUJFC2pi4ZKl i4yZThoQNr4pbvkKVix65W/AKmJiInQBLxU0O3Q1DorpPQFeZsPuu7YNp0ixxA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627611283; a=rsa-sha256; cv=none; b=Wa3Vw6FcHqnVl9cKTeP8/34bf6lAHxbS0RRYxTrGn2tg6y+HlGJKZtuAJ4KaJv4+k7n+Cv SAylh3a736TZAhX6bHaoSoy45MCcHuonAQB+4nVpmy9cBIWSesxS1TrJ3I5iI9t3yUT0bk 06mFmHenW5p9wa9urb4eT6IH7ZSXfJvYPzPt+AoyqGvm7TK4vV9Ti08QDOwpvK+FztB+It 0ID2KA7QszuY7r81ssP7bdSYN7i5pVTM/XmKUV3tmWvtHm0UZTdLi+ypDeUVMqHLwa5aEJ XG5+uS4BzLyGeepg5/RCVlwKetJNg9YSv56CeJfEXoyLFJ3fUjWFsAO/4nrOfA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=FtCiLPvM; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 1.62 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=FtCiLPvM; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 211AD47F1 X-Spam-Score: 1.62 X-Migadu-Scanner: scn1.migadu.com X-TUID: w7MBWzbEG5ar On Tue, 13 Jul 2021 21:02:28 -0300, David Bremner wrote: > Feedback of any kind is welcome, but particularly on UI / UX > issues. You can get a pretty good idea of the supported syntax by > looking at the tests. I read through the commits and it looks good to me implementation-wise. I'm probably not the most experienced lisper around so take my ideas with a grain of salt. I did work professionally on a Clojure codebase for a couple of years and I've written a bunch of small programs in Racket but that's pretty much it. 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'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. 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. Hannu [0]: https://ccrma.stanford.edu/software/snd/snd/s7.html [1]: https://janet-lang.org/ [2]: https://github.com/seancorfield/honeysql