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: Re: 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: Fri, 1 Oct 2021 15:40:30 +0100 Message-ID: References: <25d8d72022b571db5291@heytings.org> <87h7e2xsl5.fsf@gmail.com> <25d8d72022e1ea7ed022@heytings.org> <87fstl7lzw.fsf@web.de> <87a6jt7ilx.fsf@web.de> <87fstlzlaq.fsf@gmail.com> <20211001070242.GC16352@tuxteam.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="1861"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tomas@tuxteam.de, emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 01 16:43:36 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 1mWJl9-0000CL-HF for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Oct 2021 16:43:35 +0200 Original-Received: from localhost ([::1]:48322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWJl8-0008Vu-Fw for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Oct 2021 10:43:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWJiO-0004Ld-1o for emacs-devel@gnu.org; Fri, 01 Oct 2021 10:40:44 -0400 Original-Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:45623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWJiL-0004Ww-MT for emacs-devel@gnu.org; Fri, 01 Oct 2021 10:40:43 -0400 Original-Received: by mail-pg1-x536.google.com with SMTP id n18so9572855pgm.12 for ; Fri, 01 Oct 2021 07:40:40 -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=uOwFkUvM2+UcFmFfOD9pe0h9ktSZ+gH1I1hGbEGSC00=; b=JYMno1RyyZtzXeOtwi+dqgs2Tu3/2/mV7FPWAGy0907zZZHuqnSW1Kk6xcErBHl7YQ oPuQuSNluD770AM2rZA/8af7v+eSVwwiU2qRJYK/JwFojW9QMc1wLbSzmMuO3I258T/n mGy8NAp4ydoTOi2OLz6j8wlJCsSj7mcnzKCv500rdgwJGXLAUe25WaMkVqa5+T2Uaklv BE9tPfFMxrczZ1Ct5LmzGwRUC1l4aSUJ2wZ9BG7KX0Jj4XbB0G4f+sZmZuXfMK+PNF/q z5owp15Y/WFmDuh3EdpphoWO1p5yohxtp4F1L8BtAy4KjKm3y3uVo6dTdJXi+u3KVTuC 4O6g== 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=uOwFkUvM2+UcFmFfOD9pe0h9ktSZ+gH1I1hGbEGSC00=; b=XPvrmm3eHXaLQr2BX+DR64+5IC9HISuyqESuKzomh9ONMshfdz9AQhK0Rpx3xFtZSi f3Ee4KboZWLtU3VRbdn8ZnWoFZbSQZTF8Dgt767HkegLescIw0PUmonTGW2AXvn2NwPt UKvKTdfVX2Z9p/JqShz38wHNQ6PdLJSSKuHUYb4k729xMGHcmCwovkEEX77NbOvxN1oG t5QVRoZcr2KH+mNeVR8xEtkpbqwzOaPkpKE+LjQ92fC1oF6rAU1E9gNpkPNqXMOu/efv lM0+xJyPrMpOqBMSd1w7RYRctZBC1qnfCPbtd2evdhM1hdvhMs+4ujlJlw4sFdk5Urpl QjQQ== X-Gm-Message-State: AOAM533LgZL1t/BtLfKSggK7tu3jdqRWNvCvQTOWRTGfwbJ/1M/HnQyN atBZtQf816YaF0ECuyMIp+43CoylFYc1F53azSU= X-Google-Smtp-Source: ABdhPJz19cUMndy0HvOjoT81RPC0StTRTkPxcDHtqKWqTnA5RoyCPVYeq1DEeXY3U1cnjPkOyuOOxT1tuFKAOcLsPWc= X-Received: by 2002:a63:4c5c:: with SMTP id m28mr9895127pgl.67.1633099239732; Fri, 01 Oct 2021 07:40:39 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=joaotavora@gmail.com; helo=mail-pg1-x536.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:275987 Archived-At: On Fri, Oct 1, 2021 at 3:30 PM Dmitry Gutov wrote: > > On 01.10.2021 16:15, Jo=C3=A3o T=C3=A1vora wrote: > > Language design never has been held back by the particular assumptions > > of a search tool, popular and ubiquitous as it may be. > > Certain language designers intentionally limit the language's power due > to usability considerations, keeping in mind their audience. What languages, what evidence for this? Anyway, many more limit the power due to performance considerations. Counts as "usability"? I guess. IME language audiences that are interested in performance usually don't care so much about ergonomics and vice versa. > Speaking of shorthands, if only the "local" part of every symbol's name > was something reliable (as is often the case in module/package systems > out there), we could still implement the search for references using > Grep fairly efficiently: you Grep across the files for the local name, > and then post-filter the references by looking at the end of the file. Yes, yes, that's basically what happens with Common Lisp, because things are separated by `:`. And in many other languages as you say. Unfortunate= ly, it's not 100% clean in Elisp because it relies on convention, not syntax. B= ut possible, yes. Would you like to work on that `thing-at-pt.el` front? > If that approach is not feasible, we're limited to searching for the > instances of 'require' forms (when the symbol/function can be mapped to > a package name) and then searching inside every such file on the second > pass. That's not the approach I was thinking of, but I hope to present a working prototype soon, which is a better way to present ideas. > read-ing the contents of every Lisp file is pretty expensive, in comparis= on. Have you benchmarked? What exactly have you benchmarked? Just `read` or `read` + `parse-partial-sexp` (i.e. building the syntax-ppss cache)? Versus what? Jo=C3=A3o T=C3=A1vora