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: Sat, 4 Sep 2021 19:49:35 +0700 Message-ID: References: <83r1f7hydn.fsf@gnu.org> <95F37923-5BF9-4D81-B361-267CF119FBCA@gmail.com> <735AF34C-FD18-4A6A-A99D-E5D8EB4DE4F3@gmail.com> 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="35034"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?Q?Cl=C3=A9ment_Pit=2DClaudel?= , Theodor Thornhill , emacs-devel , Stefan Monnier , Eli Zaretskii , Stephen Leake To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 04 14:51:34 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 1mMV8w-0008v1-5q for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Sep 2021 14:51:34 +0200 Original-Received: from localhost ([::1]:50716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMV8u-00048B-3e for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Sep 2021 08:51:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMV7M-0002nr-5t for emacs-devel@gnu.org; Sat, 04 Sep 2021 08:49:56 -0400 Original-Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:33683) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mMV7K-0002d7-Gr; Sat, 04 Sep 2021 08:49:55 -0400 Original-Received: by mail-pg1-x531.google.com with SMTP id c17so1833651pgc.0; Sat, 04 Sep 2021 05:49:53 -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=z0FYSgl+1PYq9j+c9Zf1v+PaGhIJoLaWuFNgEqh769o=; b=XoNOHS3AVAQXKewRNUXQIVFMvsZbO8ODdzv1P06/i17l4BYvylKwas7B0gbJpSiaii Y6JATzRdUD43w6JkwtLmmbnlDubrxM0bzmib5iOb3JtRYL3WZLbrgB8SZmAF9q5LihdY Xu6L/m/TfS8yPwNVboUmLWl8qgKNpCt4vrIEpjnep5onXwIbGVysF2ORNWgiDQUjccM7 LAJMIuxulN4J2IwFvb32nJ893vXitacQwINOsfegm90CNToOBqjw2wKXk1ZE1eqUMLqN 9tOaey2XrjZZN72ajpKErgOIVLSKbVyI/hIlR+yFgD6VG4304Z/PHkrxzKLvAryUqbUl ziwg== 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=z0FYSgl+1PYq9j+c9Zf1v+PaGhIJoLaWuFNgEqh769o=; b=aFqPoR3KM/uvrL6MBaEVqR/2lYGoudYBnb9iFGdaT8NK2kq8K99+aqC+dE8HyX2iDf h9iW4aWVhIIyitGsa5MR08kYXt2IHlX5jmKf0MRpsiLiweqPMoZD7kIyyAyjvC2Fia3w ll/TW4zgWjWeAIUQLGhciky0NDE17tPm2mSZ5Y148DRayLsZ6u+8LqQ0x4eUXj2Kq9k1 n0PqvzETaJY0ujjqtLs1Xnk/7+KdINw8ut7TUeFGGLbInkB/wgqyJjFYxj0o1C9FMs+M a05IDk7591R/nWnAKQ/IrIOrTxME5r05QAKxldSKbY0cHqcGcs0295VfAyoCH27s/JWF SAMg== X-Gm-Message-State: AOAM530gQjJSVxyXEOZdHg1zSnpQSpA5mKPy6jiQslPOkopCYYpdoQhm qRA7YtueSj4g3kJ2YH92lqbkKdQaTbxpwrffhUI= X-Google-Smtp-Source: ABdhPJzVj5WcomUYahrmM1AeNwXUMJ3/87WdDHhzdOVEPQXw2Lll/XE7asaAjlDdbTel+PG2ZzZ+5cKLp2HgxeavuTI= X-Received: by 2002:a65:4486:: with SMTP id l6mr3557889pgq.145.1630759792090; Sat, 04 Sep 2021 05:49:52 -0700 (PDT) In-Reply-To: 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:273860 Archived-At: On Sat, Sep 4, 2021 at 1:44 PM Yuan Fu wrote: > 1) tree-sitter lacks a way to change its malloc behavior in run-time, I c= ommented on their road-map issue, but no one has replied yet, > Do you mean APIs to change its alloc/free functions at run time? Why would = we need to do that? Doesn't simply defining `ts_malloc` and related functions = work? See https://github.com/tree-sitter/tree-sitter/blob/v0.20.0/lib/src/alloc.h= #L27. > 4) I need to work on a better way to build and distribute language dynami= c modules. > I think there should be 2 mechanisms: 1. The binaries for common platforms should be built on Emacs's build infrastructure, and distributed through GNU ELPA. 2. There should be Lisp functions to download the grammar sources and compi= le them (by invoking the compiler). > You can find a script for building dynamic modules at https://github.com/= casouri/tree-sitter-module > I may be missing something here, but the grammars' compiled forms don't nee= d to be Emacs dynamic modules, right? They only need to be dynamically-loadable shared libraries. --=20 Tu=E1=BA=A5n-Anh Nguy=E1=BB=85n Software Engineer