From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter maturity Date: Sun, 29 Dec 2024 09:36:23 -0500 Message-ID: References: <1ed88fca-788a-fe9f-b6c8-edb2f49751c9@mavit.org.uk> <67428b3d.c80a0220.2f3036.adbdSMTPIN_ADDED_BROKEN@mx.google.com> <86ldwdm7xg.fsf@gnu.org> <6765355b.c80a0220.1a6b24.3117SMTPIN_ADDED_BROKEN@mx.google.com> <00554790-CACA-4233-8846-9E091CF1F7AA@gmail.com> <86msgl2red.fsf@gnu.org> <87o710sr7y.fsf@debian-hx90.lan> <8734i9tmze.fsf@posteo.net> <86plldwb7w.fsf@gnu.org> <87ttapryxr.fsf@posteo.net> <0883EB00-3BB2-4BC8-95D1-45F4497C0526@dancol.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006209e3062a699fc2" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35787"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philip Kaludercic , emacs-devel , Eli Zaretskii , Richard Stallman , manphiz@gmail.com To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 29 15:37:02 2024 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 1tRuPe-00095y-O3 for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Dec 2024 15:37:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRuPL-0000I3-4s; Sun, 29 Dec 2024 09:36:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRuPH-0000Hg-7C for emacs-devel@gnu.org; Sun, 29 Dec 2024 09:36:39 -0500 Original-Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRuPF-0001tg-60; Sun, 29 Dec 2024 09:36:38 -0500 Original-Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-436246b1f9bso13566685e9.1; Sun, 29 Dec 2024 06:36:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735482994; x=1736087794; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8svHMjDNUdlc0+OlG60d3CWgXs5rHoBJNopZXx+qFj4=; b=le2qWR1H06qP7xv/oGEYeUZfsS/BELdS18M2Pwww4t0T1CHrA1UIH12+XGSSvESaRg R0fm9v+EuqEkCfXlZY3xjTnuYSDoIFjQNpjUkD1SuLB9WM6wIScCkeOX8mQ/WZS6HpjW QD2/ybJxA74x77pGhBENRcyzJ0xV9is8nob5h9sZWgt/CtGOHAlhSRoohOoQviOXxjyD JQhdX7TKqWUt5x4SX5kgd4MrSXC7F3fLQRNQHr7oEAoqr9/TE6cwK2/B8yGUaLUqUP6M dZD+NaS7Yh1Sis0v7YQAI+vRxaOfpzMbOka6feEluN7B4zv87W3qRdMhXtfcd+hhxQB9 4a/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735482994; x=1736087794; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8svHMjDNUdlc0+OlG60d3CWgXs5rHoBJNopZXx+qFj4=; b=VLjioZCisEeqQCPYoQ+q4h/SIAuzVT6qwE/YUzSHEOCrz/3MONTBjPOC1/mf21Nzi5 0TH1hwRASszU6vATLgI8ZXyJzlbJZjYwgEBHBtQwOdeZpPnAVqRVUYEu601D3rsGK7t8 unwhQcEMGHZvPuKl0NWKWbkb76hvmoxNHtS8vYtsY3za9hBtMLyhmhxtWq6ZDWR9+9A4 FrnY8RY8/pcux12Nss8woJsqctK4P2L9r+W8Ny64zFdR6cYJYYap+V9lWLTtftIxd5/P Ed/YfqrFDCMioHyQ812n+26GH4LjoBiKFfr87MFtGQJjxwdSF1loRhNYAgSfPUBIcBtj PGbA== X-Forwarded-Encrypted: i=1; AJvYcCUX08XprweIGEW7aBcbUJhzHMzqisQ5qBV7B8XU+nP5nl5wCpMBCYFJ45kLY92EOL+Z77NavmEEZGbjnpk=@gnu.org, AJvYcCWLl+ZIq2Lc0orHed1oNzcZEH7iSvlQabHhJX/NjfJhN5WNOygMLM1VdyRoPXBhLp3+VREi@gnu.org, AJvYcCWQgYIbtZxAOQFp4VARKVREz+Vc5Hf8Fk6apz6w7AfpxccQeRNdPXU+rU3n5HBkrV9b39wg@gnu.org X-Gm-Message-State: AOJu0YzcszPqOZWhZ76t3ysUDHemsrhQHd97ZbUfYmNSr8sWFZQzCB26 7pIDGVbjya6emOJoorgq40TrzbpzlWUt8YDrtisfIYHuFElI26LrgoatqtEsfBMi7jVbIwfH5UA 0Ll0Dshjr4eCUFJg92KNH+CAb6hWv5g== X-Gm-Gg: ASbGncv5bQFCf3KsxA6PvAEBowUEztWDdhbfwMCjNiUDYYbdUAhKpmOGuQStUHwoFOq wYdplCGKOAttZ/k0j8gqGnut50VgiG1wQUCgXOZpHfhko200DAr1XWgOPcpvcW83DcVvdlQ== X-Google-Smtp-Source: AGHT+IF7+oU7vwXL139IcRkmNS26ce9DEsmbaVs0HIGvfSJOAJd/N2qtzmre+/OXuKSGuE9f6GViCFY/ejJ5e3S+ycE= X-Received: by 2002:a05:6000:4022:b0:385:e374:bd4 with SMTP id ffacd0b85a97d-38a221e1f74mr9795951f8f.3.1735482994196; Sun, 29 Dec 2024 06:36:34 -0800 (PST) In-Reply-To: <0883EB00-3BB2-4BC8-95D1-45F4497C0526@dancol.org> Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=owinebar@gmail.com; helo=mail-wm1-x32a.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, HTML_MESSAGE=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.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:327339 Archived-At: --0000000000006209e3062a699fc2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 27, 2024, 9:25=E2=80=AFAM Daniel Colascione = wrote: > > > It's a shame there's no way to write TS grammars in plain elisp. I figure > vendoring both the source and the generated code would be best, as it'd > allow building Emacs anywhere but still make it convenient on systems wit= h > needed tools (JS runtime, Rust, etc.) to update and modify the grammar. A= s > with any scheme involving checking in generated outputs, the source and > output can get out of sync, but I think there are build time guardrails w= e > can build to make sure it doesn't happen. > I looked into this last year. The tree-sitter library provides a parsing engine that references a fairly standard LR type parsing table in binary form. I got stuck in adding a generic primitive functionality for reading and writing arbitrary binary data structures based on a data description DSL, since I wouldn't want to tie the interpreter core to the data structures of an external, dynamically-loadable library. But, I wasn't sure such an extension would be accepted into emacs, as I am not an expert on the possible security implications. Other than that, emacs already has the code for calculating (LA)LR parsing tables in the semantic packages. The tree-sitter grammar compiler may have additional logic for providing multiple starting symbols, but the parsing engine should still function with a classic parsing table. Lynn --0000000000006209e3062a699fc2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable



--0000000000006209e3062a699fc2--