From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: What's missing in ELisp that makes people want to use cl-lib? Date: Wed, 15 Nov 2023 20:56:06 +0100 Message-ID: References: <320999cc-6c83-2315-0044-cc0403400af3@gutov.dev> <9ab5d2bd-a648-cae0-a4a7-ae86be10af0f@gutov.dev> <87r0kuqxbf.fsf@gmail.com> <54e115a2-fc36-3056-a030-0dbf32416ddb@gutov.dev> <43f290b0-4119-597b-c89a-0fb4c7db1665@gutov.dev> <1e7fe1ef-af7d-3222-7b9e-b569b3c97ccf@gutov.dev> <22e4cb4d-a8f3-1530-881d-b8c59c5d969b@gutov.dev> <339b58d6-5a44-8393-c2cd-4c935147dde3@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35238"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , Eli Zaretskii , michael_heerdegen@web.de, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 15 20:57:00 2023 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 1r3M0R-0008rl-SV for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Nov 2023 20:56:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3Lzh-0007VJ-6w; Wed, 15 Nov 2023 14:56:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3Lzg-0007VB-As for emacs-devel@gnu.org; Wed, 15 Nov 2023 14:56:12 -0500 Original-Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r3Lze-0001tu-QH; Wed, 15 Nov 2023 14:56:12 -0500 Original-Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5435336ab0bso110368a12.1; Wed, 15 Nov 2023 11:56:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700078168; x=1700682968; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=p1iJclt5bgRJ7Uf7/Tc1Ges6OKjPtUGq0keaLTeTt6U=; b=HiW6FdAxLbOzAvufsBwCGbNdKl/q2GSOOBLyXRxM61iCkHnS+s1EaJnU7lg5S5s80N V2KdJi4oxlfetTTJpmDOqZle5w1AEiElew/fTW8QqaEoRf8tq/sAdluT/RmiZ8BmZVvC zbDaK+72gJ1PJQ1JLWQ2P5stwZLULzsCsIz+GDSTeBJbkGj3QEiVyE/2GerBapYg+s4r 6v5OfRzqYB3AvzZGQQl5vl3XCgj2YaKxPU8ycRkJsiE861aCflqspM/NUV7yYvdMBAI6 E+L2WR97B+8ekOSlzM7w92zIpDM7+AjhaUN0QtMYMDPAw47EOb0scRae9QfRx4wbSFkK 0/sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700078168; x=1700682968; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=p1iJclt5bgRJ7Uf7/Tc1Ges6OKjPtUGq0keaLTeTt6U=; b=hisARkZj+StqPpSqVp1LiyXnBd897q9sBTNCd9nyX6nwj/MXtop5uH47BA2Z8GE83R +wPCmkxWPY898Ba82On108QCZRM5Av14PttjhH6HMcDtAVbA1zPmHES2XaQr7yKpgAti xBRXkxJVIsmkojQK9lnYVul0R/HoJr8ozkaabXDgusiFk3MFE86YR5/iwlnJiLrN2EMf 6EOH7hn5n5OYUY0aGJqopTtBhzZ9B3tyWinb2uic/6kOv2nLxe9DC4QvUQezQ8MPz/oI EV1valh8izBUDuH6ot6bRYII7pVZYNt8qNZDFJMyHmI79de7eFZAIsOxBgAAsNwu6ubX gCOA== X-Gm-Message-State: AOJu0Yy5KWQs2JB22KQQK+nRy+oM+2DNBXwsUU7sOza1OoUMvAG6AVs3 0SCwBD8Tz0jDWwvsN/VfuFGCTa9gDy8= X-Google-Smtp-Source: AGHT+IH/8LBPcClsvz61Q83iXMpBcYeFMcyy+MZZJyOJPVxY4kCB1naygEiVbe0gCA4Ui9beVDpgbQ== X-Received: by 2002:a17:906:e8c:b0:9ae:37d9:803e with SMTP id p12-20020a1709060e8c00b009ae37d9803emr10260913ejf.8.1700078167513; Wed, 15 Nov 2023 11:56:07 -0800 (PST) Original-Received: from Pro.fritz.box (p4fe3a544.dip0.t-ipconnect.de. [79.227.165.68]) by smtp.gmail.com with ESMTPSA id g9-20020a1709067c4900b009928b4e3b9fsm7552444ejp.114.2023.11.15.11.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 11:56:06 -0800 (PST) In-Reply-To: <339b58d6-5a44-8393-c2cd-4c935147dde3@gutov.dev> (Dmitry Gutov's message of "Wed, 15 Nov 2023 21:12:12 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:312771 Archived-At: Dmitry Gutov writes: > my observations say that method dispatch simply becomes slower as soon > as a generic function gets a second implementation. And that > implementation might arrive from any third-party code. To me that observation makes a lot of sense, extrapolating from PCL. It means that Emacs does an optimization that PCL also does. PCL being the CLOS implementationof CMUCL/SBCL. In the most general case, the function definition of a generic function is a discriminating function which dispatches to effective method functions based on actual argument types etc. Each effective method function then calls the applicable method functions. In the case that there is only 1 method, Emacs seems to arrange for that method function to be used as function definition of the generic function (I'm a bit simplifying here). So it avoids both using a discrimating functions, and an effective method function. In the case of more than one method, using a discrimating function cannot possibly be avoided, but I'd expect that Emacs is still able to avoid effective method functions. The emfs cannot possibly be avoided when there is more than 1 applicable method. Pretty impressive, actually. Hats off to Stefan!