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: "Bringing GNU Emacs to Native Code" at the European Lisp Symposium Date: Sat, 02 May 2020 09:43:46 -0400 Message-ID: References: <69d8b48d-bd09-41c1-a89d-ed76fe0284a4@default> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="102283"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: akrl@sdf.org, stefan@marxist.se, drew.adams@oracle.com, emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 02 15:44:39 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 1jUsRb-000QWj-4x for ged-emacs-devel@m.gmane-mx.org; Sat, 02 May 2020 15:44:39 +0200 Original-Received: from localhost ([::1]:44698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUsRa-0001bE-7d for ged-emacs-devel@m.gmane-mx.org; Sat, 02 May 2020 09:44:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUsQr-0008KP-2D for emacs-devel@gnu.org; Sat, 02 May 2020 09:43:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUsQp-0004VL-KG for emacs-devel@gnu.org; Sat, 02 May 2020 09:43:51 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13579) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUsQp-0004Uj-4u; Sat, 02 May 2020 09:43:51 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BB8D045081C; Sat, 2 May 2020 09:43:49 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 27F06450822; Sat, 2 May 2020 09:43:48 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1588427028; bh=GsuIjfDdOs+JlkZ1poJ7Qnt3RCUsz7BX7RIvKjiZeTU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=HcnLxzxWa5mnQl0lB//JR/UOSoyjck5gqeEg6mY8rMIeZngyOa1lkrHVutizQXVvY KbvZAoo3EVKSP7WPj5U6IXQglYoBols6j2CXcpHe08DfUCM7itcLXfhKEBjFyFM3Od KaHM8m66y0oZOmxge1ekeWSs6UjGsOIENke6bkIgL1o67mNNszky6GSXG/cT0pVlMZ w7E7BkFksmHGSH5m5y66kR5eDl/8Kt0YvKpxebQB/Pqyloq/cgK1/Mla4si67T3Uvo hQp4dzlMfpmPxnZER/86Xdv+p7Zi7C16eaIASzQ4PhGSmHqWIz+y+MX39AoNVEY3x6 1XeYkawCUO8lA== Original-Received: from alfajor (unknown [216.154.3.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D52251204BD; Sat, 2 May 2020 09:43:47 -0400 (EDT) In-Reply-To: (Richard Stallman's message of "Fri, 01 May 2020 22:21:43 -0400") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/02 08:59:26 X-ACL-Warn: Detected OS = 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:248436 Archived-At: > None of that applies to a compiler. Any compiler that transforms Emacs Lisp > into something else must be able to deal with dynamic binding. AFAIK it does *handle* such code (i.e. such code will run correctly), it just doesn't optimize it (in this particular case it keeps it in `.elc` form). > So there is no reason it should have trouble with dynamic binding > mode, that only means it is not finished. That's partly right. But then again, there's always something else that can be optimized. You have to prioritize. I think it's perfectly OK to say that if you want higher performance you should start by adapting your Elisp/d code to Elisp/l, especially since the compiler will be able to do a much better job with Elisp/l than Elisp/d since when compiled via libggcjit, a lexical variable will turn into (more or less) a plain normal C variable whereas a dynamic variable will only be accessed via the standard `symbol-value`, `set`, ... accessors. For this reason, on Elisp/d the native compiler won't be able to get much more speed up than that resulting from removing the while+switch interpretive overhead, whereas on Elisp/l it can go significantly further by allocating variables to registers, removing type tests, boxing/unboxing pairs, ... Stefan