From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?B?VHXhuqVuLUFuaCBOZ3V54buFbg==?= Newsgroups: gmane.emacs.devel Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) Date: Fri, 3 Apr 2020 21:34:25 +0700 Message-ID: References: <83369o1khx.fsf@gnu.org> <83imijz68s.fsf@gnu.org> <831rp7ypam.fsf@gnu.org> <83mu7ux769.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="65665"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 03 16:36:40 2020 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 1jKNR2-000Gy4-Fg for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Apr 2020 16:36:40 +0200 Original-Received: from localhost ([::1]:56390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKNR1-0001uw-Hn for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Apr 2020 10:36:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42598) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKNPG-0000wY-Rm for emacs-devel@gnu.org; Fri, 03 Apr 2020 10:34:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jKNPB-0004cE-TS for emacs-devel@gnu.org; Fri, 03 Apr 2020 10:34:50 -0400 Original-Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:43277) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jKNP9-0004au-Qj; Fri, 03 Apr 2020 10:34:43 -0400 Original-Received: by mail-pf1-x42f.google.com with SMTP id f206so3549600pfa.10; Fri, 03 Apr 2020 07:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=coXlL/pttZ1DnJQP8G3ifr8pHy6lFoZo9eqD8t3W1ww=; b=BnYke6nPNvIfRMqoBqZEEz1Z70MdeYZ42adJ4+r3PM0p/Q2zG8hMwShM6A2EV9LWaE rMfx1SbBI2V4RahA/uC5yrY21ZDL+pkWGaLrFbV5OkOKHCdzYqMBOzFE+DeZQZCACp7B gDyESRAtzpqLKZzMjxsL/syuyDnvqyfJaDy8XY0ACpSUf71XWHEGpDRgdDvdVLe8mTsu YaHpmDnpQpTqeHrQjzYlycC1HDjWYPRLSRccrCJwi7Z/0qx58Bu2cExnEdgKCbY/SMFQ QoHVembbPYAr+dHEYyw6IGXYxMa8RE1xwnwt518z/6hpduIwNqEcHKzqmkPdfSYBl9qK lEHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=coXlL/pttZ1DnJQP8G3ifr8pHy6lFoZo9eqD8t3W1ww=; b=dTr21z3LcccrGmT4CAeILs3yCd3YQ3RAgdlsQ7xLOR+vFy/WaqqnvakvoqbH9Hb5Q9 RrGDcHjP0jLARs+ZLUQwkmaU3BYr/XEbkPFgbM6gm6D8pkQybjL80iom2AlU5eB7DCIR hSkzaIZckTTQQcpRgj+UyzXsKVXX4x2oOL7hS36E2xf/kLgPjVLJ2xkxQTMz6B+SrKSL OIpsr1C3ViPUvlUHc34qUJgilY/Ai5OMnS4vUNZbmOmu4OJsT2h8+Cv03HvAJ6SKWlZr W98B1BfxOxPhuDGcBiyLMnCWXGzsX7+e4L/TFPHp755auGH7TElYc1boM05NbGZ2yAY7 /LiQ== X-Gm-Message-State: AGi0PuYjFYOO3rCf+oMekSPwrNjGc4McAG+5EXSjHhFDP47CMvtrwvoh Ln9k3FvD8XKK7NTtFz9p9xjQpjXarDnqWgiYGaYZzteOv0YQTw== X-Google-Smtp-Source: APiQypKeZdIKSArHMzB9TRu7/YHrDDV53f7EEPeK1Kb0P2/4ZNzBgjx94eyEyq67PeERk1r3FIocQoAsSP/R0uZAfM4= X-Received: by 2002:a62:e515:: with SMTP id n21mr8711554pff.103.1585924481932; Fri, 03 Apr 2020 07:34:41 -0700 (PDT) In-Reply-To: <83mu7ux769.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42f 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:246329 Archived-At: On Thu, Apr 2, 2020 at 10:02 PM Eli Zaretskii wrote: > > > From: Tu=E1=BA=A5n-Anh Nguy=E1=BB=85n > > Date: Thu, 2 Apr 2020 11:21:49 +0700 > > Cc: emacs-devel@gnu.org > > > > > Buffer text is not exactly UTF-8, it's a superset of UTF-8. So one > > > question to answer is what to do with byte sequences that are not > > > valid UTF-8. Any suggestions or ideas? How does tree-sitter handle > > > invalid byte sequences in general? > > > > > > > I haven't checked yet. It will probably bail out, which is usually the > > desired behavior. > > "Bail out" meaning that this breaks the parse? I'd be surprised if > that was what happens in these cases. But if it does, we will need to > replace such sequences by the likes of U+FFFD in the reader function > we provide. > Agreed. I'll try checking its behavior on this. > > > IOW, the issue with exposing access to buffer text to modules is IMO > > > secondary. My suggestion is first to figure out how to do this stuff > > > efficiently from within Emacs itself, as if the module interface were > > > not part of the equation. We can add that aspect back later. > > > > > > > My opinion is that it's better to experiment with this kind of stuff > > out-of-core. It can move forward faster that way, allowing more lessons > > to be learned. Real lessons, involving real-world use cases, not though= t > > exercises. > > I'm talking about trying different design ideas. It is best to do > that without being limited by what modules can and cannot do. > Building a hacked version of Emacs to test those ideas doesn't > necessarily contradict the desire to collect real-life experience. > > IOW, I suggest to test alternative design ideas that are not based on > copying portions of the buffer via Lisp strings. If those ideas are > workable (and I think they are), they will support a more scalable > implementation that exerts less memory pressure on Emacs and on the > host system. > > HTH > Yeah, I agree that going through Lisp strings for this is sub-optimal. When I have time to come back to this part, I'll hack up my local Emacs to allow dynamic modules to access buffer texts directly, to test out the idea. -- Tu=E1=BA=A5n-Anh Nguy=E1=BB=85n Software Engineer P.S. Sorry Gmail messed up my first reply.