From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: [External] : Re: Native compilation Date: Wed, 12 Jan 2022 23:38:36 +0100 Message-ID: <87ee5c37gz.fsf@zoho.eu> References: <875yr5up38.fsf@zoho.eu> <83k0flge7s.fsf@gnu.org> <87tuept0qc.fsf@zoho.eu> <83ee5tgcwv.fsf@gnu.org> <87ilv5sz9s.fsf@zoho.eu> <834k6ohp2o.fsf@gnu.org> <87ilutv5sb.fsf@zoho.eu> <83czl12xgd.fsf@gnu.org> <87tuebsp1b.fsf@zoho.eu> <831r1fa37q.fsf@gnu.org> <87czkys94w.fsf@zoho.eu> <83pmoy6w6j.fsf@gnu.org> Reply-To: Emanuel Berg Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17567"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:5UrsRWB4RUcbEVq/WVVM3n2lPaE= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 12 23:39:35 2022 Return-path: Envelope-to: geh-help-gnu-emacs@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 1n7mHE-0004K1-VR for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 12 Jan 2022 23:39:32 +0100 Original-Received: from localhost ([::1]:35278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7mHD-0005zs-A1 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 12 Jan 2022 17:39:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7mGX-0005zc-48 for help-gnu-emacs@gnu.org; Wed, 12 Jan 2022 17:38:49 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:41850) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7mGV-0005Ox-F9 for help-gnu-emacs@gnu.org; Wed, 12 Jan 2022 17:38:48 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1n7mGT-0003Ml-9k for help-gnu-emacs@gnu.org; Wed, 12 Jan 2022 23:38:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:135252 Archived-At: Eli Zaretskii wrote: > It is both. I see little sense in compiling init files > (except as a method of finding bugs in them, which means you > compile them and then throw away the .elc files). I see even > less sense in natively compiling them: you get all the > "issues" caused by natively-compiled ELisp, without any > benefits. So it's a net loss. It follows that our advice to > users should be not to do something that results in net loss > for them. Well ... okay, a general approach of course, but nonetheless. >> Or, if it indeed is a new attitude, what is the basis of >> that attitude? > > Natively-compiling Lisp files needs to make sure they are > self-contained, i.e. they don't depend on other Lisp files > that are not explicitly 'load'ed or 'require'd in them. > Otherwise you will have warnings and errors during JIT > native-compilation. Yes, but that's completely natural ... good, even? > Natively-compiling Lisp files also means you'll need to have > the original Lisp files around, or else Emacs will refuse to > load the .eln file. If you compress the source file, you > need to have Emacs built with decompression support (zlib), > otherwise Emacs will refuse to load the .eln file, claiming > that the source isn't available. Okay, why? Anyway I always have the .elc next to the .el anyway ... > Replacing the .eln file that is loaded into a running Emacs > session is "tricky" at best, because the *.eln files are > actually shared libraries in disguise, and your typical OS > doesn't like it very much when you delete a shared library > that's in use. Well, we don't intend to do that a lot ... if we do that will be interesting to know and we'll cross that bridge when/if we reach it ... >> OK, so that's the basis, but then I again ask, why are >> there gains doing this to the GNU Emacs (vanilla Emacs) >> Elisp, but not to the local (HOME) Elisp? > > Because most of the code in a typical init file doesn't > perform any significant processing that can be sped up by > natively-compiling it. Yeah ... I have 144 Elisp files [1] so maybe it isn't a typical setup. Anyway it isn't (for me) really about making anything faster anyway, it is about natively byte-compiling the Elisp ... >> Right, it doesn't look like it, either. So how do you >> natively byte-compile the file x.el? > > By using one or more of special commands designed for that. Which are? Or where is this documented perhaps better ... >>>> That happens automatically when Emacs is run, after being >>>> configured --with-native-compilation [1], and it only >>>> affects GNU Emacs Elisp, right? >>> >>> What is "that" in this case? >> >> Native byte-compilation of GNU Emacs (vanilla Emacs) Elisp. > > It happens automatically when Emacs loads a .elc file whose > .el file can be found in the usual places, yes. What places are these? I have the .elc files and they are in the same directory as the .el files - okay, so maybe they are indeed natively byte-compiled already? .eln files do exist in ~/.emacs.d/eln-cache/29.0.50-9e08bfb0 including my files, e.g. time-incal-760bfd05-7cbfad50.eln - okay, so maybe that's why I got the warning/error for just one file, .emacs - because .emacs is named .emacs and not emacs.el? Everything else taken cared of already? [1] https://dataswamp.org/~incal/emacs-init/ -- underground experts united https://dataswamp.org/~incal