From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: PL support Date: Sat, 09 May 2020 16:08:14 -0400 Message-ID: References: <9mmFgzvrBwjt_n_VJyaJdXINraNi5HsGpwq-0MLeKiJA7kG2BQA4uywrzjyz7lpRS0OZDpjEi8lspOKYUA7P_QsODsDew_8nbH960G55fmY=@protonmail.com> <878silajdl.fsf@ericabrahamsen.net> <87tv18pyh4.fsf@russet.org.uk> <83zhaih0oz.fsf@gnu.org> <83pnbegsvm.fsf@gnu.org> <83imh5hby1.fsf@gnu.org> <2e4e8ce9-d857-f3e3-31cf-a40dee67bd25@yandex.ru> <83y2q1dsvh.fsf@gnu.org> <83r1vtdrl7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="63780"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , dgutov@yandex.ru, joaotavora@gmail.com, emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 09 22:09:01 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 1jXVmP-000GS8-3R for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 22:09:01 +0200 Original-Received: from localhost ([::1]:40694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXVmO-0007hH-1Y for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 16:09:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXVlm-0006Q9-Bc for emacs-devel@gnu.org; Sat, 09 May 2020 16:08:22 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39899) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXVlj-0000He-6G; Sat, 09 May 2020 16:08:21 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8865F100AA0; Sat, 9 May 2020 16:08:17 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CEA9B100A7E; Sat, 9 May 2020 16:08:15 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1589054895; bh=4J6IXpPxmTOcQXJOr+Dp93hVno0db3hFLykhxSTo61U=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=poXag0ub5MNWMASO0U4FrpATrUF9wDSnqkpBW6Qa4h89w2fNrriqR/0Cf2fM2J+ST fU8kFo6brfS08KL9IvR120s0J1BwOnEPW3PSDX3UwFkh1eDReOCWpYZs0LVGVGGJKQ 4+IefUXKBSvAUP/Si7TkTVEQC1LObszrdx/T0eVPqTBrUiAU/lLpmh6jojEBJq8t8h qv6pirPjgNHDfvj4S5apNaBhb8KqNbbs6peQ79rFORsw16dGsNLDegXPc4ew9yRAhr BzjIDSSUQDplF9YoHwho/bQamsfw7nI1ifKBwfCyErvwN65fAHapAAf6vFGxPS1W6j 9M4tMMmufj1Tg== Original-Received: from alfajor (unknown [216.154.3.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4C4BD1207EA; Sat, 9 May 2020 16:08:15 -0400 (EDT) In-Reply-To: (Daniel Colascione's message of "Sat, 09 May 2020 09:17:38 -0700") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/09 15:38:00 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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:249572 Archived-At: > They do have this problem, and they usually address it with hand written > fix-up and glue code. (See the IntelliJ family.) I really want modes (and > multi-modes) driven entirely by declarative (and customizable!) grammars --- tree-sitter is basically doing just that. LSP is different because it usually goes further than just the grammar, providing information based on scoping and typing rules rules. Type checking is much less standardized than parsing. For parsing we know that a GLR engine should be able to handle the vast majority of circumstances fairly efficiently. For type checking every compiler implements basically its own approach by hand, and the algorithms and data-structures can be fairly different between a C++ compiler, a Rust compiler, and a Haskell compiler (and while parsing-time is usually negligible and linear in complexity, time to perform type checking is something at which engineering efforts are throw to keep it in check because it can blow up in complexity). So, I think the current state of the art is pretty far from knowing what would be a good *declarative* specification of typing rules for use by a generic tool providing the same kind of functionality as LSP servers. Stefan PS: We do know fairly well how to specify typing rules declaratively on paper (where efficiency is not a concern), tho, so there's hope.