From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: A read-based grep-like for symbols (el-search?) (was Do shorthands break basic tooling (tags, grep, etc)? (was Re: Shorthands have landed on master)) Date: Thu, 30 Sep 2021 23:22:38 +0100 Message-ID: References: <16338bdc2497fc51c6fb6d54ab370bfb@webmail.orcon.net.nz> <874ka5gsqa.fsf@gnus.org> <25d8d72022b571db5291@heytings.org> <87h7e2xsl5.fsf@gmail.com> <25d8d72022e1ea7ed022@heytings.org> <87fstl7lzw.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29067"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 01 00:23:42 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mW4Sr-0007MS-CY for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Oct 2021 00:23:41 +0200 Original-Received: from localhost ([::1]:54922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW4Sp-0007iF-Ra for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Sep 2021 18:23:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW4S3-00071U-C4 for emacs-devel@gnu.org; Thu, 30 Sep 2021 18:22:51 -0400 Original-Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:44747) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mW4S1-00045l-F5 for emacs-devel@gnu.org; Thu, 30 Sep 2021 18:22:51 -0400 Original-Received: by mail-pf1-x435.google.com with SMTP id 145so6227463pfz.11 for ; Thu, 30 Sep 2021 15:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=XV3xBX/jI0padSiRsKt5Ao4kIClWEXb1SzXwLgxnEwo=; b=mw/SBq4yLQA3peovcCgeXRkB0w/zrFombN4Q0ElA2itiK6gblsGPBo0k5SQQ+VCoT4 0/cBVA1uGvsY7sn/kBannGqvfuCsTNpghgrtLJZhNyk/HONv7fLncf+q9MwnRiySwCzZ Ty8tVTcg3h8EuffRFm5+NjH09tR7uReL1WVZrrZUQMor7fBqco4G7Kn70tZHlH9Bc6XA +zV3FZ2WwBM+4Tu++5lz+sXa0m7gkm9a7LSFDDnl+yUQyrms6NDXrYu+FUPtoItPORzl yiZfNqmyh0CvO+86GVzGxFho0/YGjt2TjjsaEyHhMLnrxYld4J49qJ54MzKQnXx51Ud1 O7Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=XV3xBX/jI0padSiRsKt5Ao4kIClWEXb1SzXwLgxnEwo=; b=hNUV0xANZ94N5iteuQ4RtjP8HaAPnSYHAtxXmqKTdSHAz6FDGm5unKBfeExoDHTYO9 xkjrPEnlOCTIsUP49pAtlwylFS0KAvjJbhKSOklH42pj/SgIoRenM/mwoIds4oc8QnS0 Q/jYWzPVmeXjqCl5QPongPAQ09hUeFwZvRgSwBvyzmGs9eiPJ9zJWu7l+NxbbLCEotY9 5PQFiuUVZ4IgUXVfbjUtM6yFnH4Ycs6cretNz0yt8JOknPod3p+LKn3dBi9vosABNdGi jOcVuFltbHwzK8nEA52tPK7w6yvd8JJrai81FynvK+cKwnKnDpRjjYp6P7X8wnfQb3T/ iFSQ== X-Gm-Message-State: AOAM532soncL342H4T3sBgt93pMaW6+jDTWrWLvmdusp2U1ZVxtN8SA1 3H8q/J793BdotifZjzWSqFKSIhIndp/e0ricrU8= X-Google-Smtp-Source: ABdhPJyXOMTqdj3w8p1WopEnXaV7HtLfVfri8XIVGa46D/b6ea0MbMHlVwTXAiJFk2qz4XBuSVNUgsQoh1EmQLArCGc= X-Received: by 2002:a63:3648:: with SMTP id d69mr6822737pga.295.1633040567628; Thu, 30 Sep 2021 15:22:47 -0700 (PDT) In-Reply-To: <87fstl7lzw.fsf@web.de> Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=joaotavora@gmail.com; helo=mail-pf1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275933 Archived-At: On Thu, Sep 30, 2021 at 11:11 PM Michael Heerdegen wrote: > > Drew Adams writes: > > > > Tools that understand the symbolic nature of the Lisp > > > family of languages. For the example you have since, > > > Tools that rely on way or the other really on the > > > 'read' Lisp primitive. > > > > https://github.com/emacsmirror/el-search > > Yes, thanks Drew. Indeed I was wondering whether shorthands would break > el-search, but it was trivial to add support for them because el-search > is (solely) based on `read'ing. Therefore it's slower than grepping of > course, but it's still acceptable (~ 10 seconds for the entire Emacs > Lisp code base) The "searching for symbols" problem is one of those embarrassingly parallel ones, right? Also, I can of course imaging that the `read' ing sexps is lower than readi= ng lines, but once you fill up an obarray with all the symbols you read, you d= on't pay for the string comparison, since matching symbols to the search pattern (presumably also a symbol) should be much faster since you can just use the hashing of the obarray. I haven't read or tried your code yet, I'm just speculating on possible approaches. Jo=C3=A3o