From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: native compilation units Date: Sun, 12 Jun 2022 14:47:08 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="451"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Andrea Corallo , emacs-devel@gnu.org To: Lynn Winebarger Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 12 20:48:06 2022 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 1o0Sd3-000ANG-FG for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Jun 2022 20:48:05 +0200 Original-Received: from localhost ([::1]:38192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0Sd1-0005ft-Ul for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Jun 2022 14:48:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0ScH-0004u1-33 for emacs-devel@gnu.org; Sun, 12 Jun 2022 14:47:17 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:50318) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0ScE-0001rO-AK for emacs-devel@gnu.org; Sun, 12 Jun 2022 14:47:15 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 78160808A2; Sun, 12 Jun 2022 14:47:12 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 1AE88804BD; Sun, 12 Jun 2022 14:47:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1655059631; bh=MUKFkmvdZpsFUbCA3+Fprc7xs2Q2RBPuAV1sF3mZOls=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ZMpsMZ8B/K/OuqwkUS5rpQUpAGgHxsMjydBsRFTf/dy2/BIpQmVaZo95IyH5r/Yrq 6Xz4ciZO5sdZt5IgCzKbMtU1w4uziqfdz92EUBq9YzjzUhNwL0hs2OJrOKXyN7Ogrn pD9qhm885EbRuSzvtWmWt6GI0+dd4wdoO6/PmlwG+NZpwCjOHwIvuBLv8th/+XU8l/ BxhiHJ2iHF9O2DkHRuPrv0DMIKb6ffbSKopcofivkh7x2GZfLZ0iyjGV6JWrfqMfPP WTn+ngTOLaCQ+2HEnU3xCR7G23VLI2j25oze10YhxwsFpV+VhEYapBTfPqQnzbu1lW iMjRGzRaZzfrA== Original-Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C0F8F1202AF; Sun, 12 Jun 2022 14:47:10 -0400 (EDT) In-Reply-To: (Lynn Winebarger's message of "Sun, 12 Jun 2022 13:38:40 -0400") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:291103 Archived-At: >> >> In which sense would it be different from: >> >> >> >> (cl-flet >> >> ... >> >> (defun ...) >> >> (defun ...) >> >> ...) >> >> >> >> >> > Good point - it's my scheme background confusing me. I was thinking defun >> > would operate with similar scoping rules as defvar and establish a local >> > binding, where fset (like setq) would not create any new bindings. >> >> I was not talking about performance but about semantics (under the >> assumption that if the semantics is the same then it should be possible >> to get the same performance somehow). > > I'm trying to determine if there's a set of expressions for which it > is semantically sound to perform the intraprocedural optimizations The cl-flet above is such an example, AFAIK. Or maybe I don't understand what you mean. > I'm trying to capture a function as a first class value. Functions are first class values and they can be trivially captured via things like (setq foo (lambda ...)), (defalias 'foo (lambda ...)) and a lot more, so I there's some additional constraint you're expecting but I don't know what that is. > This was not expected with lexical scope. You explicitly write `(require 'cl-lib)` but I don't see any -*- lexical-binding:t -*- anywhere, so I suspect you forgot to add those cookies that are needed to get proper lexical scoping. > With the current byte-codes, there's just no way to express a call to > an offset in the current byte-vector. Indeed, but you can call a byte-code object instead. Stefan