From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: arthur miller Newsgroups: gmane.emacs.devel Subject: RE: Using incremental parsing in Emacs Date: Sun, 5 Jan 2020 19:23:16 +0000 Message-ID: References: <83blrkj1o1.fsf@gnu.org> <20200105141900.GA71296@breton.holly.idiocy.org> ,<83eewdg3vy.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_VI1P194MB0429C500AC68B5A51575B37C963D0VI1P194MB0429EURP_" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="241521"; mail-complaints-to="usenet@blaine.gmane.org" Cc: "alan@idiocy.org" , "emacs-devel@gnu.org" To: Eli Zaretskii , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 05 20:23:34 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ioBUr-0010ce-Iz for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2020 20:23:33 +0100 Original-Received: from localhost ([::1]:44592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioBUp-0007r6-D2 for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2020 14:23:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47198) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioBUi-0007qj-0G for emacs-devel@gnu.org; Sun, 05 Jan 2020 14:23:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioBUg-00063J-60 for emacs-devel@gnu.org; Sun, 05 Jan 2020 14:23:23 -0500 Original-Received: from mail-oln040092068031.outbound.protection.outlook.com ([40.92.68.31]:18756 helo=EUR02-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ioBUd-000607-4H; Sun, 05 Jan 2020 14:23:19 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ta+lrIct33wS4QXBP08h545js1TNj882T/YAZj0xcY1SSrmaUv/gOTM/dDD/Fcwf122ugrMm8IvHpISK8ggNhEphsYgx3NEvNOnzG/PW2yG8xGj8UlNcVzRxk6vcCmA/gpLIUnX99kHEBDkt7yt7ObD6yMlEwxl1oVslSKbJt9I2iH1eg4oC6brifjaWm9Ur3AO27q7eHvWH3/fICSgnV5XJInD3m7xPyyR8yz16TdEINst+baVhDdCPdAYFGUOctSHcSeMJAQIgQrGgZUA5/5sZS5BCtszReY54WjJheQdzrR18zdiBmB0sNFO+/UWyF8nXuyKX0J9Ksd3T0Qx/hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9v3Aqb+aoUteF91/ElHpJY25TuRC7/CNtDDs1OmZPbQ=; b=jlIn+hBgC4OAg34PZNGy1qA/9QXWNgbqGAytWi8YWvLNp6deISx71eehht4jhzEJetywidIV2Io86sHxaHX2zWzByK9P3UoYHCd34cE05UYVz8j1FhiXI0SVqZRur8pi64506tGLGssP7cTk2Snpb9ZtqCHLEt1L80rElHilG/irSueSSYzy46Ex4HWqgcBpov4QdlqlwPzJWhvMIod8aunIccs6mw4uLm5tbfmoZuSLNGCO9tnE/hGFC+dDmDoZtXn6KUTHu6RZBpUfem8InrhV/C5lmazgYyaoVYs/U9U9jau5dKIPpozLtVn8deKHg8zLtChL606xAE1fY84nVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9v3Aqb+aoUteF91/ElHpJY25TuRC7/CNtDDs1OmZPbQ=; b=Aq6a89v7ob7aeRbTd1LhCg/6uH4Et8sB1ju9K4itBB91e6C7Bqu/n6ffmMVNIzMq5Y2dnZq/Lk6GaXbK2RE0IBODjUmmEpsEkTpBErE/aQTeRxy5AKqpDtmzQ3qyP0E1kz6eT+qlhWK9e/B0+ZvETAmkaeqzO1ZkbGatJJj2aXGIIyygl83jmbYLsjyeqaYyikvNXv36RrqIlSXmLXrMWh33k1osFaDCqwXXpEHA564zr0WknXVqStEmwQzctNO9MH2ogoW6eH3pN6BdMsHpF8HIgOfanEPQaTkphD1ICN8zfl9f+6q9e9FOuU5qOhPCsgGcK8whQDkfIJUTSjtBRA== Original-Received: from VE1EUR02FT012.eop-EUR02.prod.protection.outlook.com (10.152.12.52) by VE1EUR02HT177.eop-EUR02.prod.protection.outlook.com (10.152.12.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11; Sun, 5 Jan 2020 19:23:16 +0000 Original-Received: from VI1P194MB0429.EURP194.PROD.OUTLOOK.COM (10.152.12.60) by VE1EUR02FT012.mail.protection.outlook.com (10.152.12.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11 via Frontend Transport; Sun, 5 Jan 2020 19:23:16 +0000 Original-Received: from VI1P194MB0429.EURP194.PROD.OUTLOOK.COM ([fe80::35f2:9ea2:efd6:1d46]) by VI1P194MB0429.EURP194.PROD.OUTLOOK.COM ([fe80::35f2:9ea2:efd6:1d46%5]) with mapi id 15.20.2602.015; Sun, 5 Jan 2020 19:23:16 +0000 Thread-Topic: Using incremental parsing in Emacs Thread-Index: AQHVwh1Uy8tVxqoXLEaWXDDoUSKGMKfa+yPXgAEmyACAAC+sCIAAFFzvgAAQ+pA= In-Reply-To: <83eewdg3vy.fsf@gnu.org> Accept-Language: sv-SE, en-US Content-Language: sv-SE x-incomingtopheadermarker: OriginalChecksum:C3A9EB709757732912E7AB40BDDC9611DE5705832DE582EA8DA6A9E990D8FAD9; UpperCasedChecksum:08F620FC7AC02D7C5A239F901238F0317B620038B5CF104026756D2060B0484E; SizeAsReceived:7088; Count:46 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [ykmsXrH7YkW71naNDYczsdzowMe/Id1l] x-ms-publictraffictype: Email x-incomingheadercount: 46 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 1d6d470f-7783-410b-d4d3-08d79214b703 x-ms-traffictypediagnostic: VE1EUR02HT177: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: IInkA0sCjQeNkPrQx8QRyVnR5glyRGAk6wHiXwAH76qz1yARAW6CRejfDU5tDQE3fgsYXSTZKJ/NXS83xeKKk36pxlS/9vVZr6g49mVfDAyFaV0jlkbdBe37NPyzOb7yolv1JxL4EFk828JEyCowI9rlWtzJNDL5zL6DwGf23Wtbdxm1zIjKrAXTPs00hu/e x-ms-exchange-transport-forked: True X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 1d6d470f-7783-410b-d4d3-08d79214b703 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jan 2020 19:23:16.3407 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR02HT177 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.92.68.31 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243995 Archived-At: --_000_VI1P194MB0429C500AC68B5A51575B37C963D0VI1P194MB0429EURP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I think there are two use-cases: 1) batch processing where entire file (or visible portion) is processed by = different thread(s), for example on file opening or if some expansion takes= place (yasnippet or similar). This can be done by dividing text in number of blocks (lines or similar) an= d letting each thread match block atva time against shared pattern database= . 2) interactive use; when user is typing actively. Interactive use is easy, just match ladt word after certain delimiters are = typed. Probably does not need threading, but can't be done with multiple th= reads as well. Multiple threads can match one word at a time against patte= rns database split in blocks. Case 2 is probably not worth the round-trip t= ime to the bus, but I don't know. Just as a thought. Would it be possible? Skickat fr=E5n min Samsung Galaxy-smartphone. -------- Originalmeddelande -------- Fr=E5n: Eli Zaretskii Datum: 2020-01-05 19:22 (GMT+01:00) Till: Stefan Monnier Kopia: alan@idiocy.org, emacs-devel@gnu.org =C4mne: Re: Using incremental parsing in Emacs > From: Stefan Monnier > Cc: Eli Zaretskii , emacs-devel@gnu.org > Date: Sun, 05 Jan 2020 12:09:08 -0500 > > I was more thinking about having the new system work concurrently > with the rest of Elisp. I.e. have one CPU run Elisp while other > CPU(s) do the syntax processing, How do you give the syntax-processing thread access to buffer text, if it's running asynchronously? --_000_VI1P194MB0429C500AC68B5A51575B37C963D0VI1P194MB0429EURP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I think there are two use-cases:

1) batch processing where entire file (or visible portion= ) is processed by different thread(s), for example on file opening or if so= me expansion takes place (yasnippet or similar).

This can be done by dividing text in number of blocks (li= nes or similar) and letting each thread match block atva time against share= d pattern database. 

2) interactive use; when user is typing actively.
 
Interactive use is easy, just match ladt word after certa= in delimiters are typed. Probably does not need threading, but can't be don= e with multiple threads  as well. Multiple threads can match one word = at a time against patterns database split in blocks. Case 2 is probably not worth the round-trip time to the bus, bu= t I don't know.

Just as a thought. Would it be possible?

Skickat fr=E5n min= Samsung Galaxy-smartphone.



-------- Originalmeddelande --------
Fr=E5n: Eli Zaretskii <eliz@gnu.org>
Datum: 2020-01-05 19:22 (GMT+01:00)
Till: Stefan Monnier <monnier@iro.umontreal.ca>
Kopia: alan@idiocy.org, emacs-devel@gnu.org
=C4mne: Re: Using incremental parsing in Emacs

> From: Stefan Monnier <monnier@iro.umontrea= l.ca>
> Cc: Eli Zaretskii <eliz@gnu.org>,  emacs-devel@gnu.org
> Date: Sun, 05 Jan 2020 12:09:08 -0500
>
> I was more thinking about having the new system work concurrently
> with the rest of Elisp.  I.e. have one CPU run Elisp while other<= br> > CPU(s) do the syntax processing,

How do you give the syntax-processing thread access to buffer text, if
it's running asynchronously?

--_000_VI1P194MB0429C500AC68B5A51575B37C963D0VI1P194MB0429EURP_--