From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: [SPAM UNSURE] Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) Date: Fri, 03 Apr 2020 10:11:07 +0200 Message-ID: References: <83369o1khx.fsf@gnu.org> <83imijz68s.fsf@gnu.org> <831rp7ypam.fsf@gnu.org> <86wo6yhj4d.fsf@stephe-leake.org> <83o8sax803.fsf@gnu.org> <86pncpffmk.fsf@stephe-leake.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="41075"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 03 10:19:44 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 1jKHYF-000AZU-Lt for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Apr 2020 10:19:43 +0200 Original-Received: from localhost ([::1]:51940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKHYE-0006bR-Oc for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Apr 2020 04:19:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43587) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKHQ0-00046A-Hq for emacs-devel@gnu.org; Fri, 03 Apr 2020 04:11:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jKHPz-0000eB-96 for emacs-devel@gnu.org; Fri, 03 Apr 2020 04:11:12 -0400 Original-Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:36528) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jKHPz-0000dV-2I for emacs-devel@gnu.org; Fri, 03 Apr 2020 04:11:11 -0400 Original-Received: by mail-wm1-x32c.google.com with SMTP id d202so6692764wmd.1 for ; Fri, 03 Apr 2020 01:11:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=eYEBwZFcvGmOTLTpzs1tgxdGBchPrtTXfb8/GzLtOH0=; b=HS4iPhKCd9PnmNgQTEPFpGivzJG5COsrz7kwfXp3lpJv+ZK7hi0ijxfYfWjtsKzS6j rmWofa0f3xBf0IMAmhLwdahlzQShWBVxHAKsNOWJ3PIIw5ARgLxgFIm6SMCqAw8UAvk3 LMUGbNSrKt5hBYPlHXXN8nLFJRd4kuIkeq4lhKJgj+Tj56rHvw/aItpKvGFgFOcjSq5o bEgikzvqX5L4KARD+a81GaWC3V8orbTPXunkMfEI/Y5Hcsl5ZuCV06rlnBmAa/RdevRb o7iMsOS09OZGH6Pt+naTYz3+Q9I55JXF3UqaxnAHN6Bmm4ppFZXemijfQXfk6dIscl2Z rUCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=eYEBwZFcvGmOTLTpzs1tgxdGBchPrtTXfb8/GzLtOH0=; b=nyD2UMEvVSZkZFPV5WwqHd6rYy087nBvoAV/jHy3hGLEu7t5xZAAvnmKvN8KByiAZH 3hjFPcEWdctF6Hd6egvuKPslZ4KehdRs09pW6FTDiYhVI5SLWGPvCLtWbH+MyD6WUGge JeQeqkE+2Sexz0iyB6gywYufMmluR6CBSmaOVtJDE/mgTpD27hB7Y9O/nPsss8lyzdRn QYqRYmtFqPg909DcOAz8j8vKPbyth2kmo2U9H6HToAOazdIKuu/IoQ8k3SnjZwGLTenn seMr4azsmhUREKSt9q5BokFr67SSPzgX89T/BUkZl+2KgOL2fg7T40tk9argJiPCA6bX NAEA== X-Gm-Message-State: AGi0Pua3WhZ0C6p6yDl0aN/GLRy1wOULtgWos0mp3jNQzMJWtu0hbW7Z OLMq9wVO7yM1uFw8MV6eMwFbeVvw X-Google-Smtp-Source: APiQypLQD4/ZDSF1DoGffaiwvGYR6HX3HX8murShDjkxj2ZZ/CQyvexyhYoAnZEQpCPiOCiOZq6Vcg== X-Received: by 2002:a1c:6387:: with SMTP id x129mr7529863wmb.58.1585901469239; Fri, 03 Apr 2020 01:11:09 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:30c1:b817:7653:c738]) by smtp.gmail.com with ESMTPSA id f16sm4217509wmc.37.2020.04.03.01.11.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 01:11:08 -0700 (PDT) Gmane-Reply-To-List: yes In-Reply-To: <86pncpffmk.fsf@stephe-leake.org> (Stephen Leake's message of "Thu, 02 Apr 2020 18:49:07 -0800") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32c 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:246310 Archived-At: >>>>> On Thu, 02 Apr 2020 18:49:07 -0800, Stephen Leake said: Stephen> Eli Zaretskii writes: >>> From: Stefan Monnier >>> Date: Wed, 01 Apr 2020 22:46:18 -0400 >>> Cc: emacs-devel >>>=20 >>> If the GC is the worry, we can use a function which encodes the >>> buffer using a given coding-system and returns a malloc'd array of = bytes. >>=20 >> I think we should try to avoid both copying and encoding the text we >> send to the parser. Both operations are expensive and require memory >> allocation. Stephen> I don't understand what the alternative is. The parser imposes= the Stephen> reasonable requirement that the input text be utf-8 (or possib= ly some Stephen> other standard format). Emacs raw buffer text is not utf-8, so= we must Stephen> do some encoding. It=CA=BCs pretty close, apart from raw bytes. How much of an imposition would it be in practice to say 'source code must not contain raw bytes'? Stephen> If we try to pass a plain pointer to a point in the Emacs inte= rnal Stephen> buffer, there is no way to do that encoding. As pointed out elsewhere, you'd have to take the gap into account, so it would be two pointers and two lengths to describe the entire buffer text. Robert