From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter introduction documentation Date: Mon, 2 Jan 2023 22:58:13 -0800 Message-ID: References: <87cz8jxoat.fsf@ledu-giraud.fr> <83wn6ri7pn.fsf@gnu.org> <5e0a3185-de82-b339-0fa2-956779e63d6f@cornell.edu> <868rj6vfep.fsf@gmail.com> <4895891b-e5ea-9c37-f51b-df2e479ee758@yandex.ru> <83y1qt11xq.fsf@gnu.org> <9eb013da-d0fc-8e17-c6e3-1e8f913aebfa@yandex.ru> <83pmc50xxc.fsf@gnu.org> <71cfe4e8-3bb8-b0a6-9be5-8c0a6d92cfab@yandex.ru> <83h6xg29z3.fsf@gnu.org> <87wn6cyey5.fsf@posteo.net> <787B1EB4-1925-4679-8747-449DCD685432@gmail.com> <83y1qo6h7a.fsf@gnu.org> <837cy64v2f.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="34827"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Philip Kaludercic , Dmitry Gutov , Tim Cross , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 03 07:59:12 2023 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 1pCbGR-0008pY-RH for ged-emacs-devel@m.gmane-mx.org; Tue, 03 Jan 2023 07:59:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCbFd-0000Ik-Ku; Tue, 03 Jan 2023 01:58:21 -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 1pCbFb-0000IA-Cp for emacs-devel@gnu.org; Tue, 03 Jan 2023 01:58:19 -0500 Original-Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pCbFZ-00062o-GT; Tue, 03 Jan 2023 01:58:18 -0500 Original-Received: by mail-pj1-x1030.google.com with SMTP id o8-20020a17090a9f8800b00223de0364beso35005274pjp.4; Mon, 02 Jan 2023 22:58:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qLcG6QL3SXQ2ZPlXiONrv9Z1+Hb3KNBPtmNbYg/NqDE=; b=nNSTR6b8VQNvmVokHdNJQ1p8k7dPqjxbuAG3/ftSdAHiofMNSROH2qjChKO8D83pDU odUaYS7Gkl2sewbuHipKDEXqBxm6EYOcT5gbyoGJUqw0Z4vHfjh8Ro59MmaVels5uxQ+ Revpx9CCYubXHzcRN3707C4bFBMTWTJWVYzJU6cRLmQpABGzXsrhL+xYi6xRuZ/d78p9 QtR2ta7oQibDZNN5tlJHOxcpkhqtj0CS8qC//vDgijH228CA9pXuM6e5byUIeiWICE0N Kajne9PpwLEBUyY1deYYy8ge9bLzgDpQcDrGXg3569p9K2sArFcrPc1Oq3JQe3WXKwVE UI/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qLcG6QL3SXQ2ZPlXiONrv9Z1+Hb3KNBPtmNbYg/NqDE=; b=OVuFqdf7PnFfbxxK/0rCThEOz9aJB4XmTu2/ZDOrHxp0Q2pKsEZceVZORYJjGtp+Yf Fg72vuA5wcPdGAGN8liHsE6nlB7lLj8mwLJAdHPE1/+s7c1Cn3vnkbf2ePPx5nwDtJbw shq+lZm9aTvRtjwFzeIkIHKEdzfZ+9zfMpN+jsltbge+kxtyF83ZZ4LGvtjkOMiiWfsZ HyzAtFAQvSNQEYuIae/kMsS+3hK0b5nJwWYCif8Y3i3gW/EBzhBU1LVNRcYmWeLBCHRQ ZNYwteKqSCK1CoSlFRLnKD3jrsN/iZP/Ymb1BBOpbodVEgNCEQbrP8b8fK23Da4A+Nao jUAQ== X-Gm-Message-State: AFqh2koud9j84j9ajdFhXtoWAcYQYD96RR5X41aGg2R1+cLMoiKpskmb MCrNttuMcSzNsYqIQ7qe96Q= X-Google-Smtp-Source: AMrXdXs6W7L7a492WzZPd3SHXOgGQT1Hv3SEYiE1Sam2tC2u2f4hmxL4YLu3UvyfXcf/UIoVzV6qyQ== X-Received: by 2002:a17:902:e483:b0:192:94c4:f98b with SMTP id i3-20020a170902e48300b0019294c4f98bmr20455410ple.64.1672729095482; Mon, 02 Jan 2023 22:58:15 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id p23-20020a1709027ed700b00178b6ccc8a0sm21400736plb.51.2023.01.02.22.58.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jan 2023 22:58:15 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=casouri@gmail.com; helo=mail-pj1-x1030.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.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:302209 Archived-At: > On Jan 1, 2023, at 4:40 PM, Stefan Monnier = wrote: >=20 >>>>> I think we should default to asynchonous operations as much as = possible. >>>> If you are talking about the whole command, maybe. Does = call-process >>>> automatically yield when ran in a make-thread? >>> No, it doesn't. And it's threads that yield, not Emacs primitives. = A >>> thread will yield when it calls some API that invokes pselect. >> Thanks. I guess what I=E2=80=99m asking is that if I run the command = in make-thread, >> will the thread yield when it=E2=80=99s waiting for the subprocess? I = tried it and >> it still blocks Emacs so I guess the answer is no. But maybe I=E2=80=99= m doing >> it wrong. >=20 > No, indeed by "asynchronous" I wasn't thinking of using threads, but > rather using `start-process` and then putting the "rest" into its > sentinel. >=20 > It's rather cumbersome to do, admittedly. > I have a work-in-progress library of "promises/futures" for Emacs = which > should (eventually) make it easier, but that's not an option for the > `emacs-29` branch :-( Oh cool. This would have made some of my packages easier to write :-) I = wish there=E2=80=99s also something like emacs-async: spawn a separate = interpreter process, do some computations and return the result. Yuan=