From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Ludlam Newsgroups: gmane.emacs.devel Subject: Re: Shrinking EIEIO objects Date: Thu, 01 Jan 2015 21:40:59 -0500 Message-ID: <54A6053B.5060001@siege-engine.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1420166483 10693 80.91.229.3 (2 Jan 2015 02:41:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Jan 2015 02:41:23 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 02 03:41:16 2015 Return-path: Envelope-to: ged-emacs-devel@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 1Y6sAq-0007pE-5N for ged-emacs-devel@m.gmane.org; Fri, 02 Jan 2015 03:41:12 +0100 Original-Received: from localhost ([::1]:50153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6sAp-0007Ff-7v for ged-emacs-devel@m.gmane.org; Thu, 01 Jan 2015 21:41:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6sAm-0007Fa-6s for emacs-devel@gnu.org; Thu, 01 Jan 2015 21:41:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y6sAi-0004yv-5b for emacs-devel@gnu.org; Thu, 01 Jan 2015 21:41:08 -0500 Original-Received: from mail-qg0-f54.google.com ([209.85.192.54]:42311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6sAi-0004yn-1F for emacs-devel@gnu.org; Thu, 01 Jan 2015 21:41:04 -0500 Original-Received: by mail-qg0-f54.google.com with SMTP id l89so12447155qgf.41 for ; Thu, 01 Jan 2015 18:41:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=LPz2vbDVNbgbwjpO7VKTMCVVo/+Hi9yzcbVdaWEMhOY=; b=gK94D4YZp5MOI9mQjGVm76F0EwYclbZR9C3B/Z0NfaAzWXO6MmPSco2D3UK5PqVtsY SKjHAWacHCxN+NONi4N/bQWdEh9GR8QFR8jPrTQC6WI/+zPP2Mf6/ksHiZuMm0deG0pV dVAanJqwFIn8pvjyjrL2OYn4d9CvzRhlAyvgK4Q6I3xc+G0DXcV6mgzERLz/7bl3NRuU J8ROsX6aq1JRDNZ1mHC/ny7yDMCw6Cjxx9oGV789//VYHUxeX6iHuVcaUzzFmv9PuKjL yF01eFBMcMO3nxdaX4ndVbo0YBbZGot6MtkwVSWdTH0Blx/cFpBpsFCkoYE+q7mngmeX k2pA== X-Received: by 10.224.2.65 with SMTP id 1mr32286083qai.94.1420166462822; Thu, 01 Jan 2015 18:41:02 -0800 (PST) Original-Received: from [192.168.1.202] (pool-108-20-224-24.bstnma.fios.verizon.net. [108.20.224.24]) by mx.google.com with ESMTPSA id l8sm23648361qad.43.2015.01.01.18.41.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jan 2015 18:41:01 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.54 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:180919 Archived-At: On 12/30/2014 12:59 PM, Stefan Monnier wrote: > Hi Eric, > > I'd like to install something like the patch below into Emacs's master. > What it does (along with various other side changes) is shorten the > object header from 3 fields (the constant `object', the class name, and > an object "name" field) to just one (an interned symbol with an "eieio-" > prefix, referring to the class object). This seems like a fine idea. A side effect is that the 'name' slot is gone. There have received a questions about why there is a 'name' for objects, and really the main thing was debugging. When you have piles of objects around, naming them makes it much easier to see what is going on. EIEIO objects have a short hand using a # format, and when the various prin1 tools are enabled for edebug, that short hand is used in place of the vector. This is critical when debugging semantic databases where the vectors contain thousands of symbols. Your proposed solution will enable the current source forge hosted version of CEDET to keep going, just with warning messages, which seems fine. I can convert the sourceforge version CEDET to use make-instance instead, which should be compatible before and after your change. Note that your patch still needs to update the doc string (and presumably the .texi file) for make-instance as the old notes about compatibility will no longer be relevant. > Among the side things it does, I'd mention: > - add "eieio--" prefixes to a few more entities. > - use hashtables rather than obarrays. > - use closures instead of backquoted lambdas. > - use call-next-method in the various definitions of `clone'. > - redirect defmethods when called on an alias. > - use class objects (vectors) rather than class names (symbols) at more places. These all seem like good things too. While reading through the patch, there was a bunch of changes related to doc strings and methods. The goal was if you used help on a method, such as: C-h f constructor RET (or eieio-constructor in your patch) it should list the core doc (generic) and doc for every class that has it's own implementation and custom doc. I couldn't intuit from the patch what might happen as some of the doc strings looked like they were removed? I hope this helps. Eric