From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mikael Djurfeldt Newsgroups: gmane.lisp.guile.user Subject: Re: GOOPS question Date: Fri, 30 Apr 2021 17:15:03 +0200 Message-ID: References: Reply-To: mikael@djurfeldt.com Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34322"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user To: Stefan Israelsson Tampe Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Apr 30 17:15:45 2021 Return-path: Envelope-to: guile-user@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 1lcUro-0008pA-F8 for guile-user@m.gmane-mx.org; Fri, 30 Apr 2021 17:15:44 +0200 Original-Received: from localhost ([::1]:54426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcUrn-0007TM-H0 for guile-user@m.gmane-mx.org; Fri, 30 Apr 2021 11:15:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcUrO-0007T4-Au for guile-user@gnu.org; Fri, 30 Apr 2021 11:15:18 -0400 Original-Received: from mail-vs1-f45.google.com ([209.85.217.45]:45682) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcUrM-00065y-6m for guile-user@gnu.org; Fri, 30 Apr 2021 11:15:18 -0400 Original-Received: by mail-vs1-f45.google.com with SMTP id r18so29857637vso.12 for ; Fri, 30 Apr 2021 08:15:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=FE0FkJ2drRBYjCBGRIRHK9db9sNzm0l9FzliIgu74M0=; b=hp8tMEM65i5sRHb9qEZ6ks6u8T+j4jXmP1iG7lHi0Hr+bPkbriZu6N3evoTOn/RLFs 8mw8/DlJ3FwMIoq4yMBCFkNucXqxuvKEDVrupX3QPs5KX9uPOpLjGho2Vbx2DltiCuOz 1HwAYpjHnLhAtYHEJTjMTS5LBFeSuR947TP8yt0kMEK1Y53QtRRLFuxNx2dy2GG8ZMwO 1c21tv6Z+x5S5VJ+g0/ycaHd6oufXSFvyOVAdn8O36tY1xiKLCM5UxmLZ8CKTy+wS4Y6 sPZj+RAQq+YT/aJiYnO7cikapKZgMlktDOeOlrl1iIbURj1fSMNT1kwCEcFV3XjjDaMl Q0Yg== X-Gm-Message-State: AOAM530xY50xRYgJrCLByXEAUCoa9gwXkTvPMzJBRCFHZBAdU9Bmbpxp ixd++fBI5DBaIIUYgjuMHPQgJBIgGdC+SBx6YQc= X-Google-Smtp-Source: ABdhPJzUIctzPikzDek80j2lLbyCoZZahChpV4w4AMhovAtN0ZoGO+w0fsQiewGbvhkR5Nbw+hsfFBJ8elPKlU80QZ4= X-Received: by 2002:a05:6102:38d:: with SMTP id m13mr6768411vsq.25.1619795714497; Fri, 30 Apr 2021 08:15:14 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=209.85.217.45; envelope-from=mdjurfeldt@gmail.com; helo=mail-vs1-f45.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17491 Archived-At: Preferably, the dispatch should be done as much as possible during compile time such that it takes zero time during runtime. On Fri, Apr 30, 2021 at 4:50 PM Mikael Djurfeldt wrote: > Generic method dispatch is *supposed* to be fast. It was fast once upon a > time. We should fix that. > > On Fri, Apr 30, 2021 at 2:19 PM Stefan Israelsson Tampe < > stefan.itampe@gmail.com> wrote: > >> If performance is important, a goops solution can be slow in vector-ref >> and vector-set! operations due >> to two reasons. (I have pounder an implementation of resizable python >> lists and here is my tips), >> >> 1. slot-ref/slot-set! is slow (I try to fix this using the much more >> difficult struct-ref/struct-set!) >> 2. generic-method-dispatch is slow, I try to make a wrapper function in >> which we short cut for >> python/sheme internal types and if they do not match use the >> generic method. >> >> >> On Fri, Apr 30, 2021 at 1:57 PM Mikael Djurfeldt >> wrote: >> >>> On Fri, Apr 30, 2021 at 1:11 AM Damien Mattei >>> wrote: >>> >>> > for example in the doc there is: >>> > (define-class () r i #:name "Complex") >>> > >>> > seems superclass is of no use >>> > >>> >>> Well, it certainly *is* of use in the sense that methods operating on >>> will immediately start to also accept as an >>> argument. >>> That might seem worrisome but is not if there is some agreement on which >>> operations should be implemented for all numbers. So, if you had >>> previously >>> written an algorithm which operates on numbers, there's now a good chance >>> that it would also work for objects. >>> >>