From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?VHXhuqVuLUFuaCBOZ3V54buFbg==?= Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter api Date: Sun, 5 Sep 2021 23:34:59 +0700 Message-ID: References: <83r1f7hydn.fsf@gnu.org> <95F37923-5BF9-4D81-B361-267CF119FBCA@gmail.com> <735AF34C-FD18-4A6A-A99D-E5D8EB4DE4F3@gmail.com> <83fsukwkyb.fsf@gnu.org> <838s0cwfl8.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="blaine.gmane.org:116.202.254.214"; logging-data="18405"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , Theodor Thornhill , =?UTF-8?Q?Cl=C3=A9ment_Pit=2DClaudel?= , emacs-devel , Stefan Monnier , Stephen Leake To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 05 18:36:39 2021 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 1mMv8J-0004Yj-9b for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Sep 2021 18:36:39 +0200 Original-Received: from localhost ([::1]:38076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMv8H-00057R-RM for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Sep 2021 12:36:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMv73-0004NN-Lg for emacs-devel@gnu.org; Sun, 05 Sep 2021 12:35:21 -0400 Original-Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:40767) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mMv71-0001Hw-46; Sun, 05 Sep 2021 12:35:21 -0400 Original-Received: by mail-pg1-x531.google.com with SMTP id 8so4235566pga.7; Sun, 05 Sep 2021 09:35:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=I7vHEdLwAvvQP/hkxGV+BgjegfbbM+I9zdK+Z4iXfxA=; b=mRXVvZP/KKMymKAWQdHfkz0Yx1ctHbGks2G67SOShc7Bo9DNDs2aqLphL0DcQ3cAly WCe+N4dbUh32tvHVXhPwGAtwJRZXYHnbRV9w3oQGzTRU7zYbABoDYo9lFKg3yk2xU0fD 1lFB1CuoUCGrCD2luiAUifMRhEuMCAz9OexEx/CphvLn2CPVO73qQw5SCMZCd8ORNAGJ xItLCDiL/QwCYW3Yr7KMh5TbaKYwXQPhFkVqQnZYPX+nYcj2Bo9jKPXn7xJCibR9jQCE Z4PBiBQsnz1KjY2xN4pQX3zH9Pk8C0JbKt67IsFh3dYz/1Vak3MrHLoLC01TQGVyWN0P P8vA== 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=I7vHEdLwAvvQP/hkxGV+BgjegfbbM+I9zdK+Z4iXfxA=; b=Fwm53SXmxrwmfVAxU8AEoZntAMJTWcrv+hsFUkRT7ndcWHetUSZiIH/pa4Ado3cRQP DFHaJ09f81ZNJjxUA/4UuUg++QAy4c6vCtOTt3Q+4NJhSOOXvpBfXYN3AKJRG4nF9/lF GV4HDT78uixl9KaK3leSVZyAC8KqhP0q/pbJ+go/zkPNqqI3+XByrEJ5eJLRyV2+KdFQ SiXgVcmMGf96besPEWAGJpPo6S/mKELgX8rShJnBWzx2BMitQ08heso8NjsRpCfRUXfL 1B4jWiKZ5kBTFd8zU7MuNkYybjaY/Xf01KlThtJrYlGpekjowN5iQIrEDzBQOYssx7RR fXAQ== X-Gm-Message-State: AOAM533Bveg2XdqPWucWBnNi5aRTO/lwK0be0aI578f3atFONv/GUhXe X2ACAopqK52PUxgxCc1Scx2xfAmUJdhyJW+88bN/VoDkYktRIAc0 X-Google-Smtp-Source: ABdhPJxLlEYX33Lull21+cmUq19cl+e1WmJ7au4zlxytLVu+HXEs47YoP0/uJ5nDimUehLkpwy3Eg53Orh/N4VZ61fU= X-Received: by 2002:a63:935e:: with SMTP id w30mr8152733pgm.208.1630859715863; Sun, 05 Sep 2021 09:35:15 -0700 (PDT) In-Reply-To: <838s0cwfl8.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=ubolonton@gmail.com; helo=mail-pg1-x531.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, 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.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:274016 Archived-At: On Sat, Sep 4, 2021 at 10:00 PM Eli Zaretskii wrote: > > 2. Who do we expect to build the grammar binaries? > > The ones that TS already provides? They are already built, no? Or > what do you mean by "build the grammar binaries", what kind of > binaries are those? Forgive me my ignorance. There are 2 components: TS the library (`libtree-sitter`) provides the gene= ric parts, not the grammars. The grammars come from various repositories, in so= urce form. (Some of them are owned by the tree-sitter project, some are not.) Ea= ch of those consists of a generated `parser.c` and an optional `scanner.{c,cc}`. = They provide a function `TSLanguage (*tree_sitter_c) ()`, which specifies detail= s on how to parse a specific language (e.g. the parse table). They are usually compiled into dynamically-loadable shared libraries (by a `tree-sitter` CLI program), and distributed separately from `libtree-sitter`. Tree-sitter has its own ABI versioning for these 2 components. It's easier = to ensure ABI compatibility if they are both built by the same system. That's = the case for GitHub's internal uses of tree-sitter. That's also the case with `tree-sitter` and `tree-sitter-langs` packages on MELPA. That's not the cas= e with NeoVim's tree-sitter integration, and in a source of constant headache AFAICT. If we leave `libtree-sitter` to the distro, then it also makes sense for th= e distro to provide the `tree-sitter` CLI program, and/or the grammar binaries/sources. -- Tu=E1=BA=A5n-Anh Nguy=E1=BB=85n Software Engineer