From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: On elisp running native - deferred compilation Date: Sat, 22 Feb 2020 09:19:27 -0500 Message-ID: References: <83tv5mp48l.fsf@gnu.org> <83sgl0lchm.fsf@gnu.org> <83imlwl9vm.fsf@gnu.org> <83o8uegykm.fsf@gnu.org> <74dd94a9-28cb-a5fd-dbc7-ab21009834ad@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="35935"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 22 15:20:14 2020 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 1j5Vdc-0009DG-6k for ged-emacs-devel@m.gmane-mx.org; Sat, 22 Feb 2020 15:20:12 +0100 Original-Received: from localhost ([::1]:43264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5Vdb-0005iU-8K for ged-emacs-devel@m.gmane-mx.org; Sat, 22 Feb 2020 09:20:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50482) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5Vd7-0005JW-NS for emacs-devel@gnu.org; Sat, 22 Feb 2020 09:19:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j5Vd6-0006D3-60 for emacs-devel@gnu.org; Sat, 22 Feb 2020 09:19:41 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:62868) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j5Vd5-0006Cq-W9 for emacs-devel@gnu.org; Sat, 22 Feb 2020 09:19:40 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 6CF07100B69; Sat, 22 Feb 2020 09:19:38 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A7FFB100660; Sat, 22 Feb 2020 09:19:29 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1582381169; bh=jZTXLzr44uyFjYljI3fAPb3AP+ctvyvDpt5WdL0hCh0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=oT6ajzCrp00pOnqgbvotnRDqO+Rl0zJuowFwyH9poqMNpel1DS8yrTzf9cRILppfQ jzE0vG96UCN2tW/YWWk2RDwaVjUToSg56aLhi2l+nQCbpUGibX5DeQgoXyy3EYwFXr p7v59pgu3X0OzubZkPz3EvPqp3HUtjAwV5xT6vg0jKsS7FvNdi7GA8ifD7mWN7UxIK 046SUPaJ53fNcrgaK7Q+F7dT43jYnjoBLYx8IgDlUFTtzMUQ7lBNJjjpyxUQIX9CtE I/yFd3cfLcq+sno2yZ6kM/zR+rT+OOkcvxufbJS/TVwvL0Q/WQ5hAOIgr3RpYRepJE +71N5JbVjM2DQ== Original-Received: from pastel (unknown [45.72.228.252]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 33E78120790; Sat, 22 Feb 2020 09:19:29 -0500 (EST) In-Reply-To: (Andrea Corallo's message of "Sat, 22 Feb 2020 10:15:50 +0000") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 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:245030 Archived-At: > 1- When an .elc is loaded when no .eln is present we load the .elc but > we enqeue an async compilation using 'native-compile-async'. The async > compilation queue is eaten by a configurable number of parallel > processes. > 2- When each compilation unit is finished compiling we substitute each > byte-compiled function definition with the new one. Sounds good. I'll just mention that IMO, we should move towards a model where compilation (byte or native or anything else) is performed more transparently and systematically: - Elisp source code is always compiled before being executed: currently the semantics of loading a file allows the behavior to differ between loading the .el and loading the .elc, whereas I think it should always behave like loading a .elc. The eager-macroexpansion introduced in Emacs-24 was a step in that direction. - Recompilation happens automatically (e.g. either because the source Elisp file was modified or because the compiled code doesn't match the currently running Emacs version). This also suggests that compiled files should be "hidden" and include some kind of version info. Stefan