unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@yhbt.net>
To: meta@public-inbox.org
Subject: Parse::RecDescent dependency (was: IMAP server notes, maybe JMAP?)
Date: Mon, 15 Jun 2020 06:21:14 +0000	[thread overview]
Message-ID: <20200615062114.GA19510@dcvr> (raw)
In-Reply-To: <20200609113442.GA16856@dcvr>

Eric Wong <e@yhbt.net> wrote:
> I know there's also interest in getting search usable via an
> HTTP(S) API, so maybe JMAP[1] is worth looking into since it
> seems like an easier-to-implement take on IMAP; and both
> have search.  We already use JSON for manifest.js.gz...
> 
> [1] https://lwn.net/Articles/680057/ - (a look at JMAP).
> 
> GraphQL has also come up privately, but at a glance it seems to
> suffer some of the same problems with IMAP in offering excessive
> granularity and cache-unfriendliness.   But anyways, I'm close
> to having a pretty good read-only IMAP server.  JMAP cannot be
> any harder than IMAP right? :)

<snip>

> TODO:
> 
> * Queries involving OR, NOT, and parentheses don't work, yet,
>   since Xapian's default query parser works differently than
>   the prefix (Polish) notation of IMAP.

So I've been giving Parse::RecDescent a try and it seems like an
acceptable dependency for IMAP (and possibly other) search query
parsing if we need it.  It's widely-packaged by distros with
many dependents, including Inline::C and Mail::IMAPClient; so
it's likely already installed.  I've been aware of it since
~2004 but it's my first time actually writing code to use it.

I also took a look at Regexp::Grammars, but it's unsupported on
Perl 5.18.[0-3] (I'm not sure if any distros package those versions)
and has fewer users.

Perl 5.10 regexps already support recursive descent with
(?<name>...) and (?&name) but it seems like a pain to use and
(?{ code }) behavior isn't very stable and IIRC a somewhat
common source of bugs in Perl itself.

I've also heard good things about Marpa, but it's not
packaged for CentOS 7.x and FreeBSD is missing the latest
release (or Debian is missing the stable release :x)

      reply	other threads:[~2020-06-15  6:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 11:34 IMAP server notes, maybe JMAP? Eric Wong
2020-06-15  6:21 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200615062114.GA19510@dcvr \
    --to=e@yhbt.net \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).