From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Troy Hinckley Newsgroups: gmane.emacs.devel Subject: Re: none Date: Fri, 30 Jul 2021 23:09:29 -0600 Message-ID: References: <87y29rs48j.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e9a4bc05c864573e" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5267"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 31 07:10:27 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 1m9hGU-0001Al-IB for ged-emacs-devel@m.gmane-mx.org; Sat, 31 Jul 2021 07:10:26 +0200 Original-Received: from localhost ([::1]:38818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9hGS-00009e-Sa for ged-emacs-devel@m.gmane-mx.org; Sat, 31 Jul 2021 01:10:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9hFo-0007wb-V9 for emacs-devel@gnu.org; Sat, 31 Jul 2021 01:09:45 -0400 Original-Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]:42861) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9hFm-0003mD-Um for emacs-devel@gnu.org; Sat, 31 Jul 2021 01:09:44 -0400 Original-Received: by mail-oi1-x233.google.com with SMTP id x15so16224672oic.9 for ; Fri, 30 Jul 2021 22:09:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ibPORME+SnJjYLONkbjORUNdiTM213aSzKW59hSJuxw=; b=cPKnYGfTNuI0ramSaPhU1ZjkRbiZcLoGuKQTDKSV4GVW6pEkIgVdG3N5QMO/OhAdx5 arO1znHLU7XOxAo7rnTtUFKA1lCgd3g30XrGRiFUAfxsr0SiV+NhzDNdzHWEyo5/vts4 Bv5Az8XYGm+Fq4ukVt6VISOgw5oh2lHmKYi9hcVUy3/Q6iIiSO1inkipv5oltFRvS+3s JyrcEWYItleCcd2KXfOcGbwxSrIJdfUNnyUDNaU/MucVbv20jTjL8y69BRzpCjFh3zlL rFuMJHAng6JHDp+7rbL4nPy1IddI0dgssODcTp6U2nTORrcQ2V+S6IZWmEdTCnQpETMy t6WQ== 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; bh=ibPORME+SnJjYLONkbjORUNdiTM213aSzKW59hSJuxw=; b=GQfiBqPnR1ZPFBo6AGmcNLC8fwUs3/8YsogJFHsozMATxMJNlm32MS6rebYirdVVYQ LAolWIiU23mSpMgSp9FGOMFdNpDf8bl7qvrZIMXm9OdeireJAGWp9+K8Sc87E72TV/XA 56mgRu/fRKSq0W8CNVYPJAY1lr82JAhyEwpuKn4z2T6dvcSXlS3T9EV7TDdV7zGFiOxq TmWsfOsaKPBjzJduoSDbLvjweGl1qWZ/6VTbQ7S+hbr4Wg/J6JK6ccrWAPNRN3dvGQaX 1Lk7flgAq22yizQGRSy71LkOT/Mea4Hqv24F/bSaYRXaNX4Xo2xx3or3U0QwTN77qgwH ndIw== X-Gm-Message-State: AOAM531YmnJ28/KLu/ksPdzM/uu7Fo/TRrq5G2a9y7G8xox3t/VG6tGd 0SEYGV/AP6rael/4q+wskrcz7l2N9L9HL75lGK8= X-Google-Smtp-Source: ABdhPJxVilMzCke6X6eDDVCspEXAtqn5ruM5nXFZ5whEBu8ax9lyWl2mXoMBG3IR33LSsOW4TndaLY0Rp2tWodPteeQ= X-Received: by 2002:aca:d495:: with SMTP id l143mr4178914oig.131.1627708180766; Fri, 30 Jul 2021 22:09:40 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::233; envelope-from=troyhinckley@gmail.com; helo=mail-oi1-x233.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.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:271886 Archived-At: --000000000000e9a4bc05c864573e Content-Type: text/plain; charset="UTF-8" byte-run.el does use backquotes https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-lisp/byte-run.el#n122 However I had not thought about the impacts of lazy evaluation. I guess this would require that you load the code twice: First with the interpreter, then with the byte compiler, since you can't compile a macro that has not been defined. On Fri, Jul 30, 2021 at 3:33 PM Stefan Monnier wrote: > Troy Hinckley [2021-07-27 17:54:25] wrote: > > Subject: Load order for elisp files > > User-agent: mu4e 1.2.0; emacs 28.0.50 > > I am trying to better understand the bootstrap process for Emacs and I > > have run into a chicken and egg problem. When looking for where the > > basic functions are defined, I can see that defmacro and defun are > defined in > > byte-run.el. However the code needed to evaluate a macro is in > > backquote.el. > > Hmm... no, the code in `backquote.el` is only used to macro expand uses > of backquotes (which are commonly used in macro definitions but not in > all of them) and `byte-run.el` is indeed careful not to use backquotes, > specifically because that would break the bootstrap. > > IIRC there are cases where we rely on even more subtle details, more > specifically, I seem to remember that we have functions whose body uses > macros that aren't yet defined when we define the function, and this > still works OK because this is done at a stage where macro expansion is > still lazy, so the macros in the body of the function are only expanded > when the function gets called (or when it gets byte-compiled) both of > which "happen" to take place later, when the corresponding macros have > been defined. > > > Stefan > > --000000000000e9a4bc05c864573e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

However I had no= t thought about the impacts of lazy evaluation. I guess this would require = that you load the code twice: First with the interpreter, then with the byt= e compiler, since you can't compile a macro that has not been defined.<= br>

On Fri, Jul 30, 2021 at 3:33 PM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
Troy Hinckley [2021-07= -27 17:54:25] wrote:
> Subject: Load order for elisp files
> User-agent: mu4e 1.2.0; emacs 28.0.50
> I am trying to better understand the bootstrap process for Emacs and I=
> have run into a chicken and egg problem. When looking for where the > basic functions are defined, I can see that defmacro and defun are def= ined in
> byte-run.el. However the code needed to evaluate a macro is in
> backquote.el.

Hmm... no, the code in `backquote.el` is only used to macro expand uses
of backquotes (which are commonly used in macro definitions but not in
all of them) and `byte-run.el` is indeed careful not to use backquotes,
specifically because that would break the bootstrap.

IIRC there are cases where we rely on even more subtle details, more
specifically, I seem to remember that we have functions whose body uses
macros that aren't yet defined when we define the function, and this still works OK because this is done at a stage where macro expansion is
still lazy, so the macros in the body of the function are only expanded
when the function gets called (or when it gets byte-compiled) both of
which "happen" to take place later, when the corresponding macros= have
been defined.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan

--000000000000e9a4bc05c864573e--