unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andrea Corallo <akrl@sdf.org>
Cc: larsi@gnus.org, 58509@debbugs.gnu.org
Subject: bug#58509: 29.0.50; Synchronous nativecomp
Date: Sat, 15 Oct 2022 09:45:52 +0300	[thread overview]
Message-ID: <83pmet7ffj.fsf@gnu.org> (raw)
In-Reply-To: <xjf1qraythl.fsf@ma.sdf.org> (message from Andrea Corallo on Fri,  14 Oct 2022 21:40:06 +0000)

> From: Andrea Corallo <akrl@sdf.org>
> Cc: Lars Ingebrigtsen <larsi@gnus.org>, 58509@debbugs.gnu.org
> Date: Fri, 14 Oct 2022 21:40:06 +0000
> 
> to get practical I think what Lars'd like to have is: at the end of
> 'maybe_swap_for_eln', in case the .eln is not found, a syncronous
> invocation of the native compiler to produce and use the .eln file
> (indeed only when this flag is used).
> 
> In principal as decribed it should be relatively easy, the only
> technical caveat I can think of now are potential circular dependecies
> generated by loading comp.el.

Exactly.  Couldn't this cause an infinite recursion, if compiling a
file needs to load some other file that also needs to be compiled,
etc. etc.?  For example, if some primitive is advised, we'd need to
compile the same trampoline, recursively, no?  How do we break such
vicious circles?

> The comment I have is that we could have this mode capable of being used
> also in interactive sessions, in case I think we should really think of
> a better name for the flag, something like --native-compile-sync?  Or
> anyway something that highlights the "synchronousness" of the enabled
> mechanism.

I don't think the synchronous part is important here.  What is
important is that the Lisp code is natively-compiled before it is
loaded into Emacs.  So something like native-compile-before-load,
perhaps?

Which also suggests a way out of the circular dependency thing: we
could start the compilation in a subprocess and wait for it to finish.
Then any circular dependencies would be solved in the subprocess --
which will run with --batch, so it will simply use byte-compiled Lisp
for its compilation when the corresponding .eln files aren't
available.  Of course, this means when the "main" Emacs loads the
just-produced .eln file, it will find that dependency .el files were
not yet compiled, and will have to stop and wait for their
compilation.  But that is inevitable, I think, and will simply mean we
are serializing the recursion in a brute-force manner.

Does this make sense?





  reply	other threads:[~2022-10-15  6:45 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-14 10:38 bug#58509: 29.0.50; Synchronous nativecomp Lars Ingebrigtsen
2022-10-14 10:53 ` Eli Zaretskii
2022-10-14 10:56   ` Lars Ingebrigtsen
2022-10-14 11:04     ` Eli Zaretskii
2022-10-14 11:13       ` Lars Ingebrigtsen
2022-10-14 11:49         ` Eli Zaretskii
2022-10-14 11:51           ` Lars Ingebrigtsen
2022-10-14 11:53             ` Eli Zaretskii
2022-10-14 11:59               ` Lars Ingebrigtsen
2022-10-14 12:11                 ` Eli Zaretskii
2022-10-14 12:20                   ` Lars Ingebrigtsen
2022-10-14 12:54                     ` Eli Zaretskii
2022-10-14 12:59                       ` Lars Ingebrigtsen
2022-10-14 13:05                         ` Eli Zaretskii
2022-10-14 13:15                           ` Lars Ingebrigtsen
2022-10-14 21:40           ` Andrea Corallo
2022-10-15  6:45             ` Eli Zaretskii [this message]
2022-10-15  9:22             ` Lars Ingebrigtsen
2022-10-15 16:29               ` Andrea Corallo
2022-10-16  8:50                 ` Lars Ingebrigtsen
2022-10-17  7:52                   ` Andrea Corallo
2022-10-17 11:20                     ` Lars Ingebrigtsen
2022-10-17 11:57                       ` Lars Ingebrigtsen
2022-10-17 13:41                         ` Eli Zaretskii
2022-10-17 19:30                           ` Lars Ingebrigtsen
2022-10-18 13:43                             ` Eli Zaretskii
2022-10-18 13:55                               ` Andrea Corallo
2022-10-18 18:15                                 ` Lars Ingebrigtsen
2022-10-19 19:06                                   ` Andrea Corallo
2022-10-18 18:45                                 ` Eli Zaretskii
2022-10-19 19:02                                   ` Andrea Corallo
2022-10-19 19:11                                     ` Eli Zaretskii
2022-10-19 19:31                                       ` Andrea Corallo
2022-10-20  6:43                                         ` Eli Zaretskii
2022-10-20  7:23                                           ` Andrea Corallo
2022-10-20  8:06                                             ` Eli Zaretskii
2022-10-23 10:51                                               ` Andrea Corallo
2022-10-23 11:43                                                 ` Eli Zaretskii
2022-10-23 12:10                                                   ` Andrea Corallo
2022-10-25 19:54                                                     ` Andrea Corallo
2022-10-26  2:30                                                       ` Eli Zaretskii
2022-10-26  6:40                                                         ` Andrea Corallo
2022-10-18 18:14                               ` Lars Ingebrigtsen
2022-10-18 18:32                                 ` Eli Zaretskii
2022-10-18 18:39                                   ` Eli Zaretskii
2022-10-19  9:06                                     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83pmet7ffj.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=58509@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).