From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#15880: Compute C declarations for DEFSYMs automatically. Date: Wed, 13 Nov 2013 21:29:09 -0500 Message-ID: References: <5282C8F4.5010806@cs.ucla.edu> <52830A35.2020005@cs.ucla.edu> <5283A805.7030609@cs.ucla.edu> <5284281F.3050504@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1384396219 4784 80.91.229.3 (14 Nov 2013 02:30:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Nov 2013 02:30:19 +0000 (UTC) Cc: 15880@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 14 03:30:23 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VgmhK-0003ba-KU for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Nov 2013 03:30:22 +0100 Original-Received: from localhost ([::1]:52881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgmhJ-0001oM-OL for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Nov 2013 21:30:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgmh9-0001n6-HJ for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2013 21:30:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vgmh2-0007pL-2g for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2013 21:30:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgmh2-0007oQ-0A for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2013 21:30:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vgmh1-00024v-6r for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2013 21:30:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Nov 2013 02:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15880 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 15880-submit@debbugs.gnu.org id=B15880.13843961617909 (code B ref 15880); Thu, 14 Nov 2013 02:30:03 +0000 Original-Received: (at 15880) by debbugs.gnu.org; 14 Nov 2013 02:29:21 +0000 Original-Received: from localhost ([127.0.0.1]:51002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VgmgK-00023U-OQ for submit@debbugs.gnu.org; Wed, 13 Nov 2013 21:29:21 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:43372) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VgmgH-00023G-QG for 15880@debbugs.gnu.org; Wed, 13 Nov 2013 21:29:18 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFsr+b0/2dsb2JhbABEDr8AF3OCHgEBBAFWIwULCzQSFBgNJIgeBsEtkQoDiGGcGYFegjlc X-IPAS-Result: Av4EABK/CFFsr+b0/2dsb2JhbABEDr8AF3OCHgEBBAFWIwULCzQSFBgNJIgeBsEtkQoDiGGcGYFegjlc X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="37841419" Original-Received: from 108-175-230-244.dsl.teksavvy.com (HELO pastel.home) ([108.175.230.244]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 13 Nov 2013 21:29:10 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 80AA4605B3; Wed, 13 Nov 2013 21:29:09 -0500 (EST) In-Reply-To: <5284281F.3050504@cs.ucla.edu> (Paul Eggert's message of "Wed, 13 Nov 2013 17:32:15 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:80402 Archived-At: > Hmm, well, I suppose you're right. Still, the idea of removing the > dependency on DEFSYM-related globals would preclude the potential > optimization of putting these globals into a table at compile-time. Actually, I'm not sure I understand what you're suggesting here as a table, and what the optimization could be. Are you thinking of something like: struct Lisp_Symbol symbol_structs[N]; const Lisp_Object symbol_vals[N] = { Lisp_Symbol + (EMACS_INT)(symbol_structs + 0), Lisp_Symbol + (EMACS_INT)(symbol_structs + 1), ... } #define Qfoo (symbol_vals[0]) #define Qbar (symbol_vals[1]) ... but if so, would that really be faster? I mean, can the C compiler really presume that symbol_vals[0] won't be changed and constant-fold its value at link-time? > I suppose that part of the issue is that I don't add or remove > DEFSYMs very often, so even aside from the precluded optimization > I'm reluctant to complicate the build system just to save a few > build-time cycles on these rare occasions. You might be right (tho my computers tend to be slowish and make such recompilation very noticeable). >> such that make-docfile finds the "INTERN", infers the Lisp name from the >> C name and writes a "syms.c" file which does little else but initialize >> all those symbols. > I was thinking of something even simpler: no macros at all. Sounds good, indeed. Stefan